diff options
author | Sverker Eriksson <[email protected]> | 2015-12-15 18:08:41 +0100 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2015-12-15 18:09:05 +0100 |
commit | 1a101efd5654d3d4a3e96523fbbf4eb871e61d1b (patch) | |
tree | d92bcda63602b51371403aefb19404ae47974601 /erts | |
parent | b171caedbf3ebdab8ad144f015287ca2cc30d5da (diff) | |
download | otp-1a101efd5654d3d4a3e96523fbbf4eb871e61d1b.tar.gz otp-1a101efd5654d3d4a3e96523fbbf4eb871e61d1b.tar.bz2 otp-1a101efd5654d3d4a3e96523fbbf4eb871e61d1b.zip |
erts: Fix bug in check_process_code for literals
Diffstat (limited to 'erts')
-rw-r--r-- | erts/emulator/beam/beam_bif_load.c | 14 |
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)); } } |