From a12141712c91b6225348749fea5f729a747260c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Sun, 29 Nov 2009 18:06:30 +0100 Subject: Fix glitches when native code modules are used The erlang:make_stub_module/3 BIF (which is only used for loading native code) does not zero the word that points out an on_load routine (if any). As that word most proably will contain a non-zero value, the erlang:module_loaded/1 BIF will think that the module has an on_load routine which has not returned and will always return 'false'. That in turns causes various problems for the native code test cases. --- erts/emulator/beam/beam_load.c | 1 + 1 file changed, 1 insertion(+) diff --git a/erts/emulator/beam/beam_load.c b/erts/emulator/beam/beam_load.c index 47dd98117d..99fab28dce 100644 --- a/erts/emulator/beam/beam_load.c +++ b/erts/emulator/beam/beam_load.c @@ -5090,6 +5090,7 @@ erts_make_stub_module(Process* p, Eterm Mod, Eterm Beam, Eterm Info) code[MI_COMPILE_PTR] = 0; code[MI_COMPILE_SIZE_ON_HEAP] = 0; code[MI_NUM_BREAKPOINTS] = 0; + code[MI_ON_LOAD_FUNCTION_PTR] = 0; ci = MI_FUNCTIONS + n + 1; /* -- cgit v1.2.3