diff options
author | Magnus Lång <[email protected]> | 2016-04-12 13:08:02 +0200 |
---|---|---|
committer | Magnus Lång <[email protected]> | 2016-06-30 12:01:57 +0200 |
commit | 1dd81185dfb2fd6ac30b6eb44c905128c8958cb4 (patch) | |
tree | 4455256dd37472db1188f4c0dce79db658a0e58e /erts/emulator/hipe/hipe_gc.c | |
parent | c2157dc06a8c997c207dd82cd6fa11dbcb508f11 (diff) | |
download | otp-1dd81185dfb2fd6ac30b6eb44c905128c8958cb4.tar.gz otp-1dd81185dfb2fd6ac30b6eb44c905128c8958cb4.tar.bz2 otp-1dd81185dfb2fd6ac30b6eb44c905128c8958cb4.zip |
hipe: Add assertion for gc in bif without wrapper
An easy source of tricky bugs is to start calling the garbage collector
from a built-in function without adding that bif to hipe_bif_list.m4.
With this change we, in the debug build, keep track of whether the
canonical stack and heap pointers are stored in the PCB or in
registers/stack, allowing us to catch this class of mistakes with an
assertion.
Diffstat (limited to 'erts/emulator/hipe/hipe_gc.c')
-rw-r--r-- | erts/emulator/hipe/hipe_gc.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/erts/emulator/hipe/hipe_gc.c b/erts/emulator/hipe/hipe_gc.c index d0619a0609..566c65882e 100644 --- a/erts/emulator/hipe/hipe_gc.c +++ b/erts/emulator/hipe/hipe_gc.c @@ -46,6 +46,8 @@ Eterm *fullsweep_nstack(Process *p, Eterm *n_htop) /* arch-specific nstack walk state */ struct nstack_walk_state walk_state; + ASSERT(!p->hipe.gc_is_unsafe); + if (!p->hipe.nstack) { ASSERT(!p->hipe.nsp && !p->hipe.nstend); return n_htop; @@ -136,6 +138,8 @@ void gensweep_nstack(Process *p, Eterm **ptr_old_htop, Eterm **ptr_n_htop) char *mature; Uint mature_size; + ASSERT(!p->hipe.gc_is_unsafe); + if (!p->hipe.nstack) { ASSERT(!p->hipe.nsp && !p->hipe.nstend); return; |