Restore an assignment deleted in commit 789f79b.
authorGeorge Koehler <xkernigh@netscape.net>
Wed, 8 Nov 2017 04:52:52 +0000 (23:52 -0500)
committerGeorge Koehler <xkernigh@netscape.net>
Wed, 8 Nov 2017 04:52:52 +0000 (23:52 -0500)
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

index 4441b6a..0477f21 100644 (file)
@@ -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)