aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikael Pettersson <[email protected]>2015-02-14 16:18:10 +0100
committerMikael Pettersson <[email protected]>2015-02-14 16:18:10 +0100
commit7f82fdee75c2c3c3c5eaf259e2671737163be32b (patch)
tree6e5b296f317b7466c9f9e9c5bfd54ce71542ad3b
parent7e147a05683c709128b6777d0c360fcde067f567 (diff)
downloadotp-7f82fdee75c2c3c3c5eaf259e2671737163be32b.tar.gz
otp-7f82fdee75c2c3c3c5eaf259e2671737163be32b.tar.bz2
otp-7f82fdee75c2c3c3c5eaf259e2671737163be32b.zip
don't leave a heap hole in erts_bs_get_integer_2
Reset p->htop in the oversize bignum error case to avoid leaving a hole in the heap, which would crash the debug emulator.
-rw-r--r--erts/emulator/beam/erl_bits.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/erts/emulator/beam/erl_bits.c b/erts/emulator/beam/erl_bits.c
index 642f56a15e..53c21c40e1 100644
--- a/erts/emulator/beam/erl_bits.c
+++ b/erts/emulator/beam/erl_bits.c
@@ -404,6 +404,7 @@ erts_bs_get_integer_2(Process *p, Uint num_bits, unsigned flags, ErlBinMatchBuff
hp = HeapOnlyAlloc(p, words_needed);
res = bytes_to_big(LSB, bytes, sgn, hp);
if (is_nil(res)) {
+ p->htop = hp;
res = THE_NON_VALUE;
} else if (is_small(res)) {
p->htop = hp;