Skip to content
This repository was archived by the owner on Oct 28, 2025. It is now read-only.

Conversation

@markirb
Copy link

@markirb markirb commented Jul 6, 2022

This fixes strange behavior (in C++) and resulting errors when parsing to:

uint64_t: 255 << 32 has insufficient space
int32_t: 255 << 24 also

It leads to uint64_t only being parsed to 32 bit in my case, also int32 being only "int31"s...
ASAN pointed out those as errors on the log.

This is defined behavior in C++ standard but it leads to non-wanted results.

This fixes strange behavior (in C++) and resulting errors when parsing to:

uint64_t: 255 << 32 has insufficient space
int32_t: 255 << 24 also

It leads to uint64_t only being parsed to 32 bit in my case, also int32 being only "int31"s...
ASAN pointed out those as errors on the log.
@markirb
Copy link
Author

markirb commented Jul 29, 2022

need more input on this? I played around further with this, the u/int64 is definitely a bug on all compilers, be it C or C++....

The int32_t: 255 << 24 seems to be a warning of asan, but seems to work anyways...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants