From bc59e9a04bf446b3a73f20ca0e91c122de7aa571 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Fri, 10 Oct 2014 17:42:13 +0200 Subject: erts: Fix bug when hipe tailcalls trapping BIF that disables GC Symptom: base64_SUITE:roundtrip crashes with hipe compiled stdlib. Problem: HIPE_WRAPPER_BIF_DISABLE_GC pushed a "trap frame", but the frame was only popped if the call was recursive. Solution: Only reserve "trap frame" if BIF call is recursive. --- erts/emulator/hipe/hipe_x86_glue.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'erts/emulator/hipe/hipe_x86_glue.h') diff --git a/erts/emulator/hipe/hipe_x86_glue.h b/erts/emulator/hipe/hipe_x86_glue.h index 63ad250d60..4b6e495b9a 100644 --- a/erts/emulator/hipe/hipe_x86_glue.h +++ b/erts/emulator/hipe/hipe_x86_glue.h @@ -207,6 +207,14 @@ hipe_trap_from_native_is_recursive(Process *p) return 0; } +/* Native called BIF. Is it a recursive call? + i.e should we return back to native when BIF is done? */ +static __inline__ int +hipe_bifcall_from_native_is_recursive(Process *p) +{ + return (*p->hipe.nsp != (Eterm)nbif_return); +} + /* Native makes a call which needs to unload the parameters. This differs from hipe_call_from_native_is_recursive() in -- cgit v1.2.3