Commit e0576805 authored by Michael Fraenkel's avatar Michael Fraenkel Committed by Matthew Dempsky

cmd/compile: convert untyped bool for OIF and OFOR

Updates #23834.

Change-Id: I92aca9108590a0c7de774f4fad7ded97105e3cb8
Reviewed-on: https://go-review.googlesource.com/94475Reviewed-by: 's avatarMatthew Dempsky <mdempsky@google.com>
parent 9a9a8c01
......@@ -2027,6 +2027,7 @@ func typecheck1(n *Node, top int) *Node {
typecheckslice(n.Ninit.Slice(), Etop)
decldepth++
n.Left = typecheck(n.Left, Erv)
n.Left = defaultlit(n.Left, nil)
if n.Left != nil {
t := n.Left.Type
if t != nil && !t.IsBoolean() {
......@@ -2041,6 +2042,7 @@ func typecheck1(n *Node, top int) *Node {
ok |= Etop
typecheckslice(n.Ninit.Slice(), Etop)
n.Left = typecheck(n.Left, Erv)
n.Left = defaultlit(n.Left, nil)
if n.Left != nil {
t := n.Left.Type
if t != nil && !t.IsBoolean() {
......
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