Commit 786825c5 authored by Russ Cox's avatar Russ Cox

[dev.cc] cmd/gc: tweak default fatal in ordersafeexpr for c2go

c2go was putting a fallthrough after the fatal call.
Changed c2go to know that fatal doesn't return,
but then there is a missing return at the end of
the translated Go function.
Move code around a little to make C and Go agree.

Change-Id: Icef3d55ccdde0709c02dd0c2b78826f6da33a146
Reviewed-on: https://go-review.googlesource.com/5170Reviewed-by: 's avatarJosh Bleecher Snyder <josharian@gmail.com>
parent 218ff3f9
......@@ -144,9 +144,6 @@ ordersafeexpr(Node *n, Order *order)
Node *l, *r, *a;
switch(n->op) {
default:
fatal("ordersafeexpr %O", n->op);
case ONAME:
case OLITERAL:
return n;
......@@ -191,6 +188,9 @@ ordersafeexpr(Node *n, Order *order)
typecheck(&a, Erv);
return a;
}
fatal("ordersafeexpr %O", n->op);
return nil; // not reached
}
// Istemp reports whether n is a temporary variable.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment