Don't crash trying to dump move hops (with no output value).
authorDavid Given <dg@cowlark.com>
Tue, 24 Jan 2017 22:04:33 +0000 (23:04 +0100)
committerDavid Given <dg@cowlark.com>
Tue, 24 Jan 2017 22:04:33 +0000 (23:04 +0100)
mach/proto/mcg/hop.c

index d36fa6f..d4884f7 100644 (file)
@@ -293,7 +293,9 @@ static void appendheader(struct hop* hop)
 {
     int i;
 
-    appendf("$%d.%d", hop->value->ir->id, hop->value->subid);
+    appendf("%d: ", hop->id);
+    if (hop->value)
+        appendf("$%d.%d", hop->value->ir->id, hop->value->subid);
     if (hop->ir)
         appendf(" from $%d", hop->ir->id);
     appendf(":");