Skip to content

Commit 00635de

Browse files
committed
cmd/compile: don't report newLimit discovered when unsat happens multiple times
Fixes #71852 Change-Id: I696fcb8fc8c0c2e5e5ae6ab50596f6bdb9b7d498 Reviewed-on: https://go-review.googlesource.com/c/go/+/650975 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Keith Randall <khr@golang.org>
1 parent 0de8fc8 commit 00635de

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

src/cmd/compile/internal/ssa/prove.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -552,8 +552,9 @@ func (ft *factsTable) newLimit(v *Value, newLim limit) bool {
552552
}
553553

554554
if lim.unsat() {
555+
r := !ft.unsat
555556
ft.unsat = true
556-
return true
557+
return r
557558
}
558559

559560
// Check for recursion. This normally happens because in unsatisfiable

test/fixedbugs/issue71852.go

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// compile
2+
3+
// Copyright 2025 The Go Authors. All rights reserved.
4+
// Use of this source code is governed by a BSD-style
5+
// license that can be found in the LICENSE file.
6+
7+
package main
8+
9+
import (
10+
"math"
11+
)
12+
13+
func main() {
14+
test(2)
15+
}
16+
17+
func test(i int) {
18+
if i <= 0 {
19+
return
20+
}
21+
22+
_ = math.Pow10(i + 2)
23+
}

0 commit comments

Comments
 (0)