Which gives me the following runtime error
bloaty: integer overflow
I've added a debug print before the overlow and it seems it goes wrong when checking for an overflow with a negative accum (-4, 6). Maybe this is because of an earlier error but it seems that checker function doesn't allow to overflow from negative to postive numbers
CheckedAdd: -4 6
bloaty: integer overflow
A workaround for me would be changing the function into this, but my guess that there's a more fundamental problem
// Original version
bool safe = *accum < 0
? (val >= std::numeric_limits<int64_t>::max() - *accum)
: (val <= std::numeric_limits<int64_t>::max() - *accum);
// Version that allows for overflow from negative to positive
bool safe = *accum < 0
? (val <= std::numeric_limits<int64_t>::max() + *accum)
: (val <= std::numeric_limits<int64_t>::max() - *accum);
I'm comparing the following files using this command with master bloaty
nxp_fmuk66-v3_default.zip nxp_fmuk66-v3_default_upstream.zip
bloaty -d compileunits nxp_fmuk66-v3_default.elf -- nxp_fmuk66-v3_default_upstream.elf
Which gives me the following runtime error
bloaty: integer overflow
I've added a debug print before the overlow and it seems it goes wrong when checking for an overflow with a negative accum (-4, 6). Maybe this is because of an earlier error but it seems that checker function doesn't allow to overflow from negative to postive numbers
A workaround for me would be changing the function into this, but my guess that there's a more fundamental problem