IRC channel logs

2021-09-19.log

back to list of logs

<stikonas>argh, it looks like hex2_word.c in one place deliberately relies on 32-bit unsigned integer overflow
<stikonas>which goes wrong with 64 bit registers
<stikonas>well, should be easy to fix..
<stikonas>or at least easy to fix in hex2...
<stikonas>hex1 is a bit more annoying to fix because it would mean fixing hex1.hex0 code but I guess we don't have to fix hex1
<Hagfish>that's a great find
<Hagfish>is integer overflow undefined behaviour, that could be caught by a static analyser?
<stikonas>Hagfish: no, unsigned overflow is not undefined
<stikonas>also in high level languages (e.g. C++), unsigned overflow is well defined operation
<stikonas>only signed overflow is undefined
<stikonas>and oriansj used it intentionally I think
<stikonas>because to get the right result you have to use overflow there
<stikonas>(i'm talking about https://github.com/oriansj/mescc-tools/blob/master/hex2_word.c#L102 line)
<Hagfish>that's really insightful, thank you
<xentrac> https://www.theonion.com/i-believe-the-robots-are-our-future-1819583606