From e48518e4520146d4b8461689c2aab5882478339f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20L=C3=A5ng?= Date: Fri, 29 Apr 2016 16:18:23 +0200 Subject: erl_process: Restore R18 HiPE PCB offsets It was recently observed that the LLVM backend for HiPE was broken, generating code that crashes the VM. It turns out that this was caused by LLVM hard-coding an offset into the Erlang PCB, which became incorrect as of commit 3ac08f9b, that introduced a new member into the PCB before the HiPE-specific state, changing its offsets. For now, until a proper fix is implemented, we move this new member to after the HiPE-specific state, allowing the LLVM backend to work once more. --- erts/emulator/beam/erl_process.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'erts/emulator/beam/erl_process.h') diff --git a/erts/emulator/beam/erl_process.h b/erts/emulator/beam/erl_process.h index 61acf5924b..1c01d705a7 100644 --- a/erts/emulator/beam/erl_process.h +++ b/erts/emulator/beam/erl_process.h @@ -925,7 +925,6 @@ struct process { Eterm* stop; /* Stack top */ Eterm* heap; /* Heap start */ Eterm* hend; /* Heap end */ - Eterm* abandoned_heap; Uint heap_sz; /* Size of heap in words */ Uint min_heap_size; /* Minimum size of heap (in words). */ Uint min_vheap_size; /* Minimum size of virtual heap (in words). */ @@ -940,6 +939,16 @@ struct process { struct hipe_process_state hipe; #endif + /* + * Moved to after "struct hipe_process_state hipe", as a temporary fix for + * LLVM hard-coding offsetof(struct process, hipe.nstack) (sic!) + * (see void X86FrameLowering::adjustForHiPEPrologue(...) in + * lib/Target/X86/X86FrameLowering.cpp). + * + * Used to be below "Eterm* hend". + */ + Eterm* abandoned_heap; + /* * Saved x registers. */ -- cgit v1.2.3