]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.cc] cmd/gc: tweak default fatal in ordersafeexpr for c2go
authorRuss Cox <rsc@golang.org>
Wed, 18 Feb 2015 02:52:42 +0000 (21:52 -0500)
committerRuss Cox <rsc@golang.org>
Fri, 20 Feb 2015 00:16:53 +0000 (00:16 +0000)
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>
src/cmd/gc/order.c

index 255c94a804961c1ec95b0f668270bd2579359561..8e670bdc13f3de8e963b5a2a88e010d6a2e41651 100644 (file)
@@ -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.