From 52ee3178786bfc48adf676ad29aac296348ce650 Mon Sep 17 00:00:00 2001 From: David Given Date: Tue, 18 Sep 2018 23:32:53 +0200 Subject: [PATCH] Fixed some bad mcg ir code generation: only nodes which have been appendir'd may be used multiple times. --- mach/proto/mcg/treebuilder.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mach/proto/mcg/treebuilder.c b/mach/proto/mcg/treebuilder.c index 5f9eebf86..3328bf620 100644 --- a/mach/proto/mcg/treebuilder.c +++ b/mach/proto/mcg/treebuilder.c @@ -85,6 +85,8 @@ static struct ir* pop(int size) } else if ((size == EM_wordsize) && (ir->size == (EM_wordsize*2))) { + appendir(ir); + /* Tried to read an int, but we got a long. */ push( new_ir1( @@ -553,6 +555,7 @@ static void insn_simple(int opcode) { struct ir* label = new_labelir(".trppc"); struct ir* value = pop(EM_pointersize); + appendir(label); /* because we need to use label twice */ push( load( EM_pointersize,