aboutsummaryrefslogtreecommitdiff
path: root/map.c
diff options
context:
space:
mode:
authorBen Harris <bjh21@bjh21.me.uk>2023-02-26 14:24:38 +0000
committerBen Harris <bjh21@bjh21.me.uk>2023-02-26 22:47:18 +0000
commit93be3f7ccaa63b0fd953bcfd88d685b47b76605e (patch)
treebd23eeedb0c6c75492b67379c2fd29226e828a94 /map.c
parent9dbcfa765ba59a8201425df18bec09c7bc334c5e (diff)
downloadpuzzles-93be3f7ccaa63b0fd953bcfd88d685b47b76605e.zip
puzzles-93be3f7ccaa63b0fd953bcfd88d685b47b76605e.tar.gz
puzzles-93be3f7ccaa63b0fd953bcfd88d685b47b76605e.tar.bz2
puzzles-93be3f7ccaa63b0fd953bcfd88d685b47b76605e.tar.xz
Be more careful with type of left operand of <<
On a 32-bit system, evaluating 1<<31 causes undefined behaviour because 1 is signed and so it produces signed overflow. UBSan has spotted a couple of occasions where this happens in Puzzles, so in each case I've converted the left operand to the unsigned result type we actually want.
Diffstat (limited to 'map.c')
0 files changed, 0 insertions, 0 deletions