aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam
diff options
context:
space:
mode:
authorJohn Högberg <[email protected]>2019-03-26 15:07:34 +0100
committerJohn Högberg <[email protected]>2019-03-26 15:07:34 +0100
commitf75cf3bd6c433f71b6fd6d58dee95b0c0fb8a238 (patch)
tree7524da09d63d2d75d9b087aae7556b89508e46fe /erts/emulator/beam
parent15adea941b10ae7c31bbd89db54b3425428c49f5 (diff)
parentdfb3cbbc7918ccc2e281a86da86adbc517c43745 (diff)
downloadotp-f75cf3bd6c433f71b6fd6d58dee95b0c0fb8a238.tar.gz
otp-f75cf3bd6c433f71b6fd6d58dee95b0c0fb8a238.tar.bz2
otp-f75cf3bd6c433f71b6fd6d58dee95b0c0fb8a238.zip
Merge branch 'john/erts/explain-empty-stack-check-in-next_catch'
* john/erts/explain-empty-stack-check-in-next_catch: erts: Add an explanation for the empty stack check in next_catch
Diffstat (limited to 'erts/emulator/beam')
-rw-r--r--erts/emulator/beam/beam_emu.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/erts/emulator/beam/beam_emu.c b/erts/emulator/beam/beam_emu.c
index 73bf443372..f1d8609066 100644
--- a/erts/emulator/beam/beam_emu.c
+++ b/erts/emulator/beam/beam_emu.c
@@ -1480,7 +1480,16 @@ next_catch(Process* c_p, Eterm *reg) {
ptr = prev = c_p->stop;
ASSERT(ptr <= STACK_START(c_p));
- if (ptr == STACK_START(c_p)) return NULL;
+
+ /* This function is only called if we have active catch tags or have
+ * previously called a function that was exception-traced. As the exception
+ * trace flag isn't cleared after the traced function returns (and the
+ * catch tag inserted by it is gone), it's possible to land here with an
+ * empty stack, and the process should simply die when that happens. */
+ if (ptr == STACK_START(c_p)) {
+ ASSERT(!active_catches && IS_TRACED_FL(c_p, F_EXCEPTION_TRACE));
+ return NULL;
+ }
/*
* Better safe than sorry here. In debug builds, produce a core