aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/beam_bif_load.c
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2015-06-10 17:18:07 +0200
committerBjörn-Egil Dahlberg <[email protected]>2015-06-10 17:18:07 +0200
commitfc73f98012ab8a1688f1bdc9063bfe9d63a675c9 (patch)
treea172910c47478c661fbe44ffe0c3191280de0a38 /erts/emulator/beam/beam_bif_load.c
parent09255039607a53e2a74aa8ee1c6972982d647518 (diff)
parent528954b7ec9642f9ec987707352d558f9fd41446 (diff)
downloadotp-fc73f98012ab8a1688f1bdc9063bfe9d63a675c9.tar.gz
otp-fc73f98012ab8a1688f1bdc9063bfe9d63a675c9.tar.bz2
otp-fc73f98012ab8a1688f1bdc9063bfe9d63a675c9.zip
Merge branch 'egil/fix-purge-literals/OTP-12821'
* egil/fix-purge-literals/OTP-12821: erts: Fix garbage collect literals in code purge
Diffstat (limited to 'erts/emulator/beam/beam_bif_load.c')
-rw-r--r--erts/emulator/beam/beam_bif_load.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/erts/emulator/beam/beam_bif_load.c b/erts/emulator/beam/beam_bif_load.c
index 500a98195b..c769428266 100644
--- a/erts/emulator/beam/beam_bif_load.c
+++ b/erts/emulator/beam/beam_bif_load.c
@@ -33,6 +33,7 @@
#include "beam_catches.h"
#include "erl_binary.h"
#include "erl_nif.h"
+#include "erl_bits.h"
#include "erl_thr_progress.h"
static void set_default_trace_pattern(Eterm module);
@@ -937,7 +938,15 @@ any_heap_refs(Eterm* start, Eterm* end, char* mod_start, Uint mod_size)
break;
case TAG_PRIMARY_HEADER:
if (!header_is_transparent(val)) {
- Eterm* new_p = p + thing_arityval(val);
+ Eterm* new_p;
+ if (header_is_bin_matchstate(val)) {
+ ErlBinMatchState *ms = (ErlBinMatchState*) p;
+ ErlBinMatchBuffer *mb = &(ms->mb);
+ if (in_area(EXPAND_POINTER(mb->orig), mod_start, mod_size)) {
+ return 1;
+ }
+ }
+ new_p = p + thing_arityval(val);
ASSERT(start <= new_p && new_p < end);
p = new_p;
}