diff options
author | Sverker Eriksson <[email protected]> | 2017-02-14 18:26:31 +0100 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2017-02-14 18:26:31 +0100 |
commit | 118de47d703e303aea7f4575849a37c11416ba14 (patch) | |
tree | 211bbb6c24d6069c657d3b7ac7776be45631ec48 /erts/emulator/hipe | |
parent | dd60ebfa1f2f6dc203deee59f95305291d06a619 (diff) | |
download | otp-118de47d703e303aea7f4575849a37c11416ba14.tar.gz otp-118de47d703e303aea7f4575849a37c11416ba14.tar.bz2 otp-118de47d703e303aea7f4575849a37c11416ba14.zip |
erts: Add deallocation veto for magic destructors
A magic destructor can return 0 and thereby take control
and prolong the lifetime of a magic binary.
Diffstat (limited to 'erts/emulator/hipe')
-rw-r--r-- | erts/emulator/hipe/hipe_load.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/erts/emulator/hipe/hipe_load.c b/erts/emulator/hipe/hipe_load.c index 2998ed87a2..87c5004d2b 100644 --- a/erts/emulator/hipe/hipe_load.c +++ b/erts/emulator/hipe/hipe_load.c @@ -61,7 +61,7 @@ void hipe_free_loader_state(HipeLoaderState *stp) stp->module = NIL; } -static void +static int hipe_loader_state_dtor(Binary* magic) { HipeLoaderState* stp = ERTS_MAGIC_BIN_DATA(magic); @@ -69,6 +69,7 @@ hipe_loader_state_dtor(Binary* magic) ASSERT(ERTS_MAGIC_BIN_DESTRUCTOR(magic) == hipe_loader_state_dtor); hipe_free_loader_state(stp); + return 1; } Binary *hipe_alloc_loader_state(Eterm module) |