mirror of
https://github.com/golang/go
synced 2024-11-05 18:36:08 +00:00
cmd/gc: add missing case for OCOM in defaultlit()
Fixes #3765. R=golang-dev, r CC=golang-dev https://golang.org/cl/6349064
This commit is contained in:
parent
91e56e6486
commit
a732cbb593
2 changed files with 16 additions and 1 deletions
|
@ -1012,12 +1012,13 @@ defaultlit(Node **np, Type *t)
|
|||
}
|
||||
n->type = t;
|
||||
return;
|
||||
case OCOM:
|
||||
case ONOT:
|
||||
defaultlit(&n->left, t);
|
||||
n->type = n->left->type;
|
||||
return;
|
||||
default:
|
||||
if(n->left == N) {
|
||||
if(n->left == N || n->right == N) {
|
||||
dump("defaultlit", n);
|
||||
fatal("defaultlit");
|
||||
}
|
||||
|
|
14
test/fixedbugs/bug445.go
Normal file
14
test/fixedbugs/bug445.go
Normal file
|
@ -0,0 +1,14 @@
|
|||
// 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)
|
||||
}
|
Loading…
Reference in a new issue