1
0
mirror of https://github.com/golang/go synced 2024-11-14 14:40:23 -07:00
go/test/fixedbugs/issue33903.go
Josh Bleecher Snyder 2393d16147 cmd/compile: handle infinite loops in shortcircuit pass
The newly upgraded shortcircuit pass attempted to remove infinite loops.
Stop doing that.

Fixes #33903

Change-Id: I0fc9c1b5f2427e54ce650806602ef5e3ad65aca5
Reviewed-on: https://go-review.googlesource.com/c/go/+/192144
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
2019-08-29 17:41:49 +00:00

17 lines
305 B
Go

// compile
// Copyright 2019 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.
// Check that the shortcircuit pass correctly handles infinite loops.
package p
func f() {
var p, q bool
for {
p = p && q
}
}