From 97edc3ccd2d02ec829bcd481519f368200301f9c Mon Sep 17 00:00:00 2001 From: BenniTec Date: Sun, 11 Jul 2021 01:41:52 +0200 Subject: [PATCH] fixed i386 gen --- src/i386/gen.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/i386/gen.c b/src/i386/gen.c index cb2c1ea..6d62dfb 100644 --- a/src/i386/gen.c +++ b/src/i386/gen.c @@ -301,7 +301,6 @@ static ir_node_t* emit_ir(const ir_node_t* n) { if (variadic) emit_clear(reg_ax); if (is_defined(n->ifcall.name)) emit("call %s", n->ifcall.name); else { - add_unresolved(n->ifcall.name); emit("call [rel %s wrt ..got]", n->ifcall.name); } size_t add_rsp = padding; @@ -317,6 +316,8 @@ static ir_node_t* emit_ir(const ir_node_t* n) { emit("call %s", n->ifcall.name); emit("add %s, %u", reg_sp, padding + REGSIZE * np); #endif + if (!is_defined(n->ifcall.name)) + add_unresolved(n->ifcall.name); if (n->ifcall.dest != 0 && n->type != IR_FCALL) { emit("mov %s, %s", mreg(n->ifcall.dest), reg_ax); }