From 5d6a9e797a3c2d12ed54edb14851f4b023de4799 Mon Sep 17 00:00:00 2001 From: Michael Matz Date: Mon, 12 Dec 2016 20:19:10 +0100 Subject: [PATCH] x86-asm: Fix segfault We need to access cur_text_section, not text_section. --- i386-asm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i386-asm.c b/i386-asm.c index 3612627..5011af5 100644 --- a/i386-asm.c +++ b/i386-asm.c @@ -1121,7 +1121,7 @@ ST_FUNC void asm_opcode(TCCState *s1, int opcode) /* after immediate operands, adjust pc-relative address */ if (pc) - add32le(text_section->data + pc - 4, pc - ind); + add32le(cur_text_section->data + pc - 4, pc - ind); } /* return the constraint priority (we allocate first the lowest