aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2015-07-08 16:13:30 +0200
committerBjörn Gustavsson <[email protected]>2015-07-08 16:30:03 +0200
commitb3b9d321ce0622e1d774ad54e9700e22edde8abd (patch)
tree8bbc9d7d47451732cfc4ff7e5a0ce567fe71c6e4
parent832aa9e06aced4975c9cb02257f74827602217aa (diff)
downloadotp-b3b9d321ce0622e1d774ad54e9700e22edde8abd.tar.gz
otp-b3b9d321ce0622e1d774ad54e9700e22edde8abd.tar.bz2
otp-b3b9d321ce0622e1d774ad54e9700e22edde8abd.zip
Fix crash when disassembling modules with BIFs
In a debug-compiled emulator, running erts_debug:df(io) would trigger an assertion failure: 1> erts_debug:df(io). beam/beam_debug.c:301:erts_debug_disassemble_1() Assertion failed: (((funcinfo[0]) & 0x3F) == ((0x0 << 4) | ((0x2 << 2) | 0x3))) Aborted (core dumped) It turns out that the assertion is wrong. It should have been updated in 64ccd8c9b7a7 which made it possible to have stubs for BIFs in the BEAM code for a module. The faulty assertion was only found when when 16317f73f79265 added a smoke test of the BEAM disassembler.
-rw-r--r--erts/emulator/beam/beam_debug.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/erts/emulator/beam/beam_debug.c b/erts/emulator/beam/beam_debug.c
index 8a35ad17c6..c774a70d4c 100644
--- a/erts/emulator/beam/beam_debug.c
+++ b/erts/emulator/beam/beam_debug.c
@@ -298,8 +298,8 @@ erts_debug_disassemble_1(BIF_ALIST_1)
(void) erts_bld_uword(NULL, &hsz, (BeamInstr) code_ptr);
hp = HAlloc(p, hsz);
addr = erts_bld_uword(&hp, NULL, (BeamInstr) code_ptr);
- ASSERT(is_atom(funcinfo[0]));
- ASSERT(is_atom(funcinfo[1]));
+ ASSERT(is_atom(funcinfo[0]) || funcinfo[0] == NIL);
+ ASSERT(is_atom(funcinfo[1]) || funcinfo[1] == NIL);
mfa = TUPLE3(hp, (Eterm) funcinfo[0], (Eterm) funcinfo[1], make_small((Eterm) funcinfo[2]));
hp += 4;
return TUPLE3(hp, addr, bin, mfa);