From a3158a1e6b7c5a0e6721dab3618b772068903fd4 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Mon, 18 Feb 2013 18:34:54 +0100 Subject: erts: Fix code:is_module_native code:is_module_native returned false for hipe compiled module if the first function in the module was a BIF stub --- erts/emulator/beam/beam_bif_load.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'erts') diff --git a/erts/emulator/beam/beam_bif_load.c b/erts/emulator/beam/beam_bif_load.c index 73264214ce..8a8239493a 100644 --- a/erts/emulator/beam/beam_bif_load.c +++ b/erts/emulator/beam/beam_bif_load.c @@ -1081,7 +1081,21 @@ beam_make_current_old(Process *c_p, ErtsProcLocks c_p_locks, Eterm module) static int is_native(BeamInstr* code) { - return ((Eterm *)code[MI_FUNCTIONS])[1] != 0; + Uint i, num_functions = code[MI_NUM_FUNCTIONS]; + + /* Check NativeAdress of first real function in module + */ + for (i=0; i