From 8bbcecd938f46127bc40ff7aed91d4e519d0cd5b Mon Sep 17 00:00:00 2001 From: Paul Guyot Date: Sat, 17 Jul 2010 14:50:53 +0200 Subject: Fix call to erts_gc_after_bif_call in hipe glue R12B-0 changed the signature of erts_gc_after_bif_call and it now takes 4 parameters instead of 2 in R11B-5. Yet, the glue code was not updated accordingly. As a result, the function erts_gc_after_bif_call was called with garbage and would randomly cause a crash later in the garbage collector code. The fix consists in passing NULL and 0 for the third and fourth parameters, since there is no term to add to rootset, recovering the behaviour of R11B-5 (see otp_src_R11B-5/erts/emulator/beam/erl_gc.c, line 314). (Includes assembly language fixes and code style improvements suggested by Mikael Pettersson.) --- erts/emulator/hipe/hipe_amd64_glue.S | 2 ++ 1 file changed, 2 insertions(+) (limited to 'erts/emulator/hipe/hipe_amd64_glue.S') diff --git a/erts/emulator/hipe/hipe_amd64_glue.S b/erts/emulator/hipe/hipe_amd64_glue.S index 83b7b0397b..ede762aae0 100644 --- a/erts/emulator/hipe/hipe_amd64_glue.S +++ b/erts/emulator/hipe/hipe_amd64_glue.S @@ -346,6 +346,8 @@ nbif_3_gc_after_bif: subq $(16-8), %rsp movq P, %rdi movq %rax, %rsi + xorl %edx, %edx # Pass NULL in regs + xorl %ecx, %ecx # Pass 0 in arity call CSYM(erts_gc_after_bif_call) addq $(16-8), %rsp movl $0, P_NARITY(P) # Note: narity is a 32-bit field -- cgit v1.2.3