aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2017-02-27 12:01:50 +0100
committerLukas Larsson <[email protected]>2017-02-27 12:01:50 +0100
commitc0f82eef818a71a8cb475d9b27a3c30074fe3b77 (patch)
tree8c7cfe0ba1649437a9e06249b0a719a7ca623ac4 /erts/emulator
parent3d0531bcc56810ed8e651dc401bae75a1b227682 (diff)
downloadotp-c0f82eef818a71a8cb475d9b27a3c30074fe3b77.tar.gz
otp-c0f82eef818a71a8cb475d9b27a3c30074fe3b77.tar.bz2
otp-c0f82eef818a71a8cb475d9b27a3c30074fe3b77.zip
erts: Fix proc arity value when exiting
Not setting it correctly will cause the swapin later to fail in debug build as REDS_IN will overwrite the value in reg[5].
Diffstat (limited to 'erts/emulator')
-rw-r--r--erts/emulator/beam/beam_emu.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/erts/emulator/beam/beam_emu.c b/erts/emulator/beam/beam_emu.c
index 49f932a1c2..8be0f58227 100644
--- a/erts/emulator/beam/beam_emu.c
+++ b/erts/emulator/beam/beam_emu.c
@@ -1324,6 +1324,7 @@ void process_main(Eterm * x_reg_array, FloatDef* f_reg_array)
goto do_schedule1;
do_schedule:
+ ASSERT(c_p->arity < 6);
ASSERT(c_p->debug_reds_in == REDS_IN(c_p));
if (!ERTS_PROC_GET_SAVED_CALLS_BUF(c_p))
reds_used = REDS_IN(c_p) - FCALLS;
@@ -1924,6 +1925,7 @@ void process_main(Eterm * x_reg_array, FloatDef* f_reg_array)
erts_smp_proc_unlock(c_p, ERTS_PROC_LOCKS_MSG_RECEIVE);
SWAPOUT;
c_p->flags &= ~F_DELAY_GC;
+ c_p->arity = 0;
goto do_schedule; /* Will be rescheduled for exit */
}
ERTS_SMP_MSGQ_MV_INQ2PRIVQ(c_p);
@@ -2166,6 +2168,7 @@ void process_main(Eterm * x_reg_array, FloatDef* f_reg_array)
* in limbo forever.
*/
SWAPOUT;
+ c_p->arity = 0;
goto do_schedule;
}
#endif