aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam
diff options
context:
space:
mode:
authorMagnus Lång <[email protected]>2015-12-02 14:30:56 +0100
committerMagnus Lång <[email protected]>2015-12-02 14:38:31 +0100
commit33299ece737c635910e358d7e09dd8af6bce1a5d (patch)
tree6131cd6a0a9061d85aaf554c787d91514c2da024 /erts/emulator/beam
parent21918b53a12107fdb1374387acd8b439515bd40d (diff)
downloadotp-33299ece737c635910e358d7e09dd8af6bce1a5d.tar.gz
otp-33299ece737c635910e358d7e09dd8af6bce1a5d.tar.bz2
otp-33299ece737c635910e358d7e09dd8af6bce1a5d.zip
beam: Fix overflow bug in i_bs_add_jId
The test whether the result would fit in a smallnum could overflow into a negative number that would fit a smallnum. A test that reproduces the issue was added to bs_construct_SUITE.
Diffstat (limited to 'erts/emulator/beam')
-rw-r--r--erts/emulator/beam/beam_emu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/erts/emulator/beam/beam_emu.c b/erts/emulator/beam/beam_emu.c
index 38def5d89f..73292885ce 100644
--- a/erts/emulator/beam/beam_emu.c
+++ b/erts/emulator/beam/beam_emu.c
@@ -4069,7 +4069,7 @@ do { \
tmp_arg1 += Arg1;
store_bs_add_result:
- if (MY_IS_SSMALL((Sint) tmp_arg1)) {
+ if (tmp_arg1 <= MAX_SMALL) {
tmp_arg1 = make_small(tmp_arg1);
} else {
/*