summaryrefslogtreecommitdiff
path: root/erts/emulator/beam/erl_unicode.c
diff options
context:
space:
mode:
authorSverker Eriksson <sverker@erlang.org>2017-02-14 18:26:31 +0100
committerSverker Eriksson <sverker@erlang.org>2017-02-14 18:26:31 +0100
commit118de47d703e303aea7f4575849a37c11416ba14 (patch)
tree211bbb6c24d6069c657d3b7ac7776be45631ec48 /erts/emulator/beam/erl_unicode.c
parentdd60ebfa1f2f6dc203deee59f95305291d06a619 (diff)
downloaderlang-118de47d703e303aea7f4575849a37c11416ba14.tar.gz
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/beam/erl_unicode.c')
-rw-r--r--erts/emulator/beam/erl_unicode.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/erts/emulator/beam/erl_unicode.c b/erts/emulator/beam/erl_unicode.c
index dd7c589c3d..01629db9ad 100644
--- a/erts/emulator/beam/erl_unicode.c
+++ b/erts/emulator/beam/erl_unicode.c
@@ -123,10 +123,11 @@ static void cleanup_restart_context(RestartContext *rc)
}
}
-static void cleanup_restart_context_bin(Binary *bp)
+static int cleanup_restart_context_bin(Binary *bp)
{
RestartContext *rc = ERTS_MAGIC_BIN_DATA(bp);
cleanup_restart_context(rc);
+ return 1;
}
static RestartContext *get_rc_from_bin(Eterm mref)