summaryrefslogtreecommitdiff
path: root/src/test-circular-array.cc
diff options
context:
space:
mode:
authorBen Smith <binji@chromium.org>2020-04-29 00:31:05 -0700
committerGitHub <noreply@github.com>2020-04-29 00:31:05 -0700
commit5c48f3bdd5ab8b7c27d4959840407ce09a31f0cf (patch)
treed2fbed7750e031ff04070843eb94f58338aad8c8 /src/test-circular-array.cc
parent5e16bf1c7ef1d2bed53db4e5a03771d2d5a12f04 (diff)
downloadwabt-5c48f3bdd5ab8b7c27d4959840407ce09a31f0cf.tar.gz
wabt-5c48f3bdd5ab8b7c27d4959840407ce09a31f0cf.tar.bz2
wabt-5c48f3bdd5ab8b7c27d4959840407ce09a31f0cf.zip
Fix address overflow bug in wasm2c (#1401)
This only occurs when the immediate offset is small (`int` sized). The stack offset is `u32` and the immediate is an `int`, so the usual arithmetic conversions converts the result to a `u32`, which wraps the address before checking for overflow. There are already spec tests for overflow, but these use an offset of `4294967295`, which is `long` (at least on LP64 systems). This means that the sum's type is `u32 + long` which is `long`. This is why the tests pass. I've added additional tests for these cases here: https://github.com/WebAssembly/spec/pull/1188 This fixes issue #1400.
Diffstat (limited to 'src/test-circular-array.cc')
0 files changed, 0 insertions, 0 deletions