Commit 03b25a92 authored by Russ Cox's avatar Russ Cox

catch

	a := true;
	a |= a;
in the front end.

R=ken
OCL=32240
CL=32243
parent 0b2683d1
...@@ -338,7 +338,7 @@ walkexpr(Node *n, int top, NodeList **init) ...@@ -338,7 +338,7 @@ walkexpr(Node *n, int top, NodeList **init)
NodeList *ll, *lr; NodeList *ll, *lr;
Type *t; Type *t;
Sym *s; Sym *s;
int et, cl, cr, typeok; int et, cl, cr, typeok, op;
int32 lno; int32 lno;
if(n == N) if(n == N)
...@@ -1252,7 +1252,10 @@ reswitch: ...@@ -1252,7 +1252,10 @@ reswitch:
* ======== second switch ======== * ======== second switch ========
*/ */
switch(n->op) { op = n->op;
if(op == OASOP)
op = n->etype;
switch(op) {
default: default:
fatal("walkexpr: switch 2 unknown op %N", n, init); fatal("walkexpr: switch 2 unknown op %N", n, init);
goto ret; goto ret;
...@@ -1423,7 +1426,10 @@ badt: ...@@ -1423,7 +1426,10 @@ badt:
badtype(n->op, n->left->type, T); badtype(n->op, n->left->type, T);
goto ret; goto ret;
} }
badtype(n->op, n->left->type, n->right->type); op = n->op;
if(op == OASOP)
op = n->etype;
badtype(op, n->left->type, n->right->type);
goto ret; goto ret;
ret: ret:
......
// errchk $G $D/$F.go
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
func f() {
a := true;
a |= a; // ERROR "illegal.*OR"
}
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