Commit a732cbb5 authored by Shenghou Ma's avatar Shenghou Ma

cmd/gc: add missing case for OCOM in defaultlit()

        Fixes #3765.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6349064
parent 91e56e64
...@@ -1012,12 +1012,13 @@ defaultlit(Node **np, Type *t) ...@@ -1012,12 +1012,13 @@ defaultlit(Node **np, Type *t)
} }
n->type = t; n->type = t;
return; return;
case OCOM:
case ONOT: case ONOT:
defaultlit(&n->left, t); defaultlit(&n->left, t);
n->type = n->left->type; n->type = n->left->type;
return; return;
default: default:
if(n->left == N) { if(n->left == N || n->right == N) {
dump("defaultlit", n); dump("defaultlit", n);
fatal("defaultlit"); fatal("defaultlit");
} }
......
// compile
// Copyright 2012 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.
// Issue 3765
package main
func f(x uint) uint {
m := ^(1 << x)
return uint(m)
}
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