aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2016-01-07 16:49:24 +0100
committerSverker Eriksson <[email protected]>2016-01-07 16:49:24 +0100
commit72b79c8c24849a7041c69b99f8e57cb6ebc7715f (patch)
tree9c787a05a239706d946141ff4e2524a5b7d0194c /erts/emulator
parent3ea54c2dc82a2e067fbd19b201e4eb03a7dbc29d (diff)
parent1a101efd5654d3d4a3e96523fbbf4eb871e61d1b (diff)
downloadotp-72b79c8c24849a7041c69b99f8e57cb6ebc7715f.tar.gz
otp-72b79c8c24849a7041c69b99f8e57cb6ebc7715f.tar.bz2
otp-72b79c8c24849a7041c69b99f8e57cb6ebc7715f.zip
Merge branch 'sverk/check_process_code-fix'
* sverk/check_process_code-fix: erts: Fix bug in check_process_code for literals
Diffstat (limited to 'erts/emulator')
-rw-r--r--erts/emulator/beam/beam_bif_load.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/erts/emulator/beam/beam_bif_load.c b/erts/emulator/beam/beam_bif_load.c
index c925a8c812..956454d9b3 100644
--- a/erts/emulator/beam/beam_bif_load.c
+++ b/erts/emulator/beam/beam_bif_load.c
@@ -826,6 +826,9 @@ check_process_code(Process* rp, Module* modp, int allow_gc, int *redsp)
ERTS_SMP_MSGQ_MV_INQ2PRIVQ(rp);
erts_smp_proc_unlock(rp, ERTS_PROC_LOCK_MSGQ);
+ literals = (char*) modp->old.code_hdr->literals_start;
+ lit_bsize = (char*) modp->old.code_hdr->literals_end - literals;
+
for (msgp = rp->msg.first; msgp; msgp = msgp->next) {
if (msgp->data.attached == ERTS_MSG_COMBINED_HFRAG)
hfrag = &msgp->hfrag;
@@ -839,14 +842,11 @@ check_process_code(Process* rp, Module* modp, int allow_gc, int *redsp)
/* Should not contain any constants... */
ASSERT(!any_heap_refs(&hfrag->mem[0],
&hfrag->mem[hfrag->used_size],
- mod_start,
- mod_size));
+ literals,
+ lit_bsize));
}
}
- literals = (char*) modp->old.code_hdr->literals_start;
- lit_bsize = (char*) modp->old.code_hdr->literals_end - literals;
-
while (1) {
/* Check heap, stack etc... */
@@ -881,7 +881,7 @@ check_process_code(Process* rp, Module* modp, int allow_gc, int *redsp)
hp = &hfrag->mem[0];
hp_end = &hfrag->mem[hfrag->used_size];
- if (any_heap_refs(hp, hp_end, mod_start, lit_bsize))
+ if (any_heap_refs(hp, hp_end, literals, lit_bsize))
goto try_literal_gc;
}
@@ -902,7 +902,7 @@ check_process_code(Process* rp, Module* modp, int allow_gc, int *redsp)
hp = &hfrag->mem[0];
hp_end = &hfrag->mem[hfrag->used_size];
- ASSERT(!any_heap_refs(hp, hp_end, mod_start, lit_bsize));
+ ASSERT(!any_heap_refs(hp, hp_end, literals, lit_bsize));
}
}