aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSverker Eriksson <sverker@erlang.org>2016-03-03 16:33:22 +0100
committerLukas Larsson <lukas@erlang.org>2016-04-15 15:07:38 +0200
commitd698386e5b101a02786c85af70f1513c6beb191b (patch)
treeef9de2c17a1aed7498c555b23c113ee7771c1c64
parent5194bb9f0a8fd058f701703e06f2b9be3dce9a91 (diff)
downloadotp-d698386e5b101a02786c85af70f1513c6beb191b.tar.gz
otp-d698386e5b101a02786c85af70f1513c6beb191b.tar.bz2
otp-d698386e5b101a02786c85af70f1513c6beb191b.zip
erts: Silence harmless valgrind warning in dec_term
provoked by nif_SUITE:nif_binary_to_term. If we fail to decode an immediate (unsafe atom for example) with a dummy factory then hp and factory->hp will both be uninitialized and valgrind will complain about comparing them.
-rw-r--r--erts/emulator/beam/external.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/erts/emulator/beam/external.c b/erts/emulator/beam/external.c
index 9f43240b7e..723c25ff77 100644
--- a/erts/emulator/beam/external.c
+++ b/erts/emulator/beam/external.c
@@ -3958,9 +3958,13 @@ error:
* Must unlink all off-heap objects that may have been
* linked into the process.
*/
- if (factory->hp < hp) { /* Sometimes we used hp and sometimes factory->hp */
- factory->hp = hp; /* the largest must be the freshest */
+ if (factory->mode != FACTORY_CLOSED) {
+ if (factory->hp < hp) { /* Sometimes we used hp and sometimes factory->hp */
+ factory->hp = hp; /* the largest must be the freshest */
+ }
}
+ else ASSERT(factory->hp == hp);
+
error_hamt:
erts_factory_undo(factory);
PSTACK_DESTROY(hamt_array);