From 786825c5e8e4b93bf7c4dbe5e5a80c3fe0cb39ed Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Tue, 17 Feb 2015 21:52:42 -0500 Subject: [PATCH] [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 --- src/cmd/gc/order.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cmd/gc/order.c b/src/cmd/gc/order.c index 255c94a8049..8e670bdc13f 100644 --- a/src/cmd/gc/order.c +++ b/src/cmd/gc/order.c @@ -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.