diff options
author | Björn Gustavsson <[email protected]> | 2012-01-31 08:08:13 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2012-02-01 15:52:11 +0100 |
commit | 0e476410666e3dfeb7e93289ff235e2b1232e5ee (patch) | |
tree | 254917126b46262bef9e2fc1fe8fff94b8eb55a3 /erts/emulator | |
parent | 42dba5a4e328a68323c5c42ceb5197e6542d6e45 (diff) | |
download | otp-0e476410666e3dfeb7e93289ff235e2b1232e5ee.tar.gz otp-0e476410666e3dfeb7e93289ff235e2b1232e5ee.tar.bz2 otp-0e476410666e3dfeb7e93289ff235e2b1232e5ee.zip |
beam_load: Fix faulty assertion in module_info(native_addresses)
Commit 64ccd8c9b7a782ca777ca4649dbb1f4a1ef00bce introduced BIF
stubs. The stub functions were not actually remove the loaded
code, but the name of the function in the func_info instruction
was changed to [] to mark it as invalid.
The actual code for module_info(native_addresses) did not need
to be updated (a BIF stub can never have a native address and
a function without a native address will never be included in
the list), but the assertion that the name is an atom is no
no longer correct.
Diffstat (limited to 'erts/emulator')
-rw-r--r-- | erts/emulator/beam/beam_load.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/erts/emulator/beam/beam_load.c b/erts/emulator/beam/beam_load.c index 1f9635a6c1..d54fe603d8 100644 --- a/erts/emulator/beam/beam_load.c +++ b/erts/emulator/beam/beam_load.c @@ -5158,9 +5158,11 @@ native_addresses(Process* p, Eterm mod) int arity = (int) func_info[4]; Eterm tuple; - ASSERT(is_atom(name)); + ASSERT(is_atom(name) || is_nil(name)); /* [] if BIF stub */ if (func_info[1] != 0) { - Eterm addr = erts_bld_uint(&hp, NULL, func_info[1]); + Eterm addr; + ASSERT(is_atom(name)); + addr = erts_bld_uint(&hp, NULL, func_info[1]); tuple = erts_bld_tuple(&hp, NULL, 3, name, make_small(arity), addr); result = erts_bld_cons(&hp, NULL, tuple, result); } |