mirror of
https://github.com/golang/go
synced 2024-11-23 20:40:07 -07:00
[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/5170 Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
This commit is contained in:
parent
218ff3f9a4
commit
786825c5e8
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user