From 0fc0faef082ac51b74793a3dc6b29616df38092c Mon Sep 17 00:00:00 2001 From: George Koehler Date: Tue, 7 Nov 2017 23:52:52 -0500 Subject: [PATCH] Restore an assignment deleted in commit 789f79b. Because of the accidental deletion, mcgg on my machine followed a garbage pointer, and never wrote calls to emit_fragment. A wrong call to `data->emit_reg(0, 0)` instead of the correct `data->emit_fragment(0)` caused PowerPC mcg to emit an empty string instead of `8(fp)`, causing a syntax error in PowerPC as. The wrong `data->emit_reg(0, 0)` called the function emit_reg() in mach/proto/mcg/pass_instructionselection.c, but that function unfortunately has `if (vreg) { ... }`. The call had vreg == NULL because the fragment wasn't a vreg, but emit_reg() ignored the problem and emit nothing. --- util/mcgg/iburg.c | 1 + 1 file changed, 1 insertion(+) diff --git a/util/mcgg/iburg.c b/util/mcgg/iburg.c index 4441b6a4a..0477f216b 100644 --- a/util/mcgg/iburg.c +++ b/util/mcgg/iburg.c @@ -1280,6 +1280,7 @@ static void emitinsndata(Rule rules) if (!find_child_index(r->pattern, label, &index, &node)) label_not_found(r, label); + nt = node->op; if (nt->kind == NONTERM) { if (nt->is_fragment) -- 2.34.1