]> Cypherpunks repositories - gostls13.git/commitdiff
[release-branch.go1.24] cmd/compile: don't report newLimit discovered when unsat...
authorJorropo <jorropo.pgm@gmail.com>
Thu, 20 Feb 2025 10:50:53 +0000 (11:50 +0100)
committerMichael Pratt <mpratt@google.com>
Wed, 26 Feb 2025 17:44:53 +0000 (09:44 -0800)
Fixes #71855

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>
(cherry picked from commit 00635de759b38610dd86f60074856367d6a1ceaa)
Reviewed-on: https://go-review.googlesource.com/c/go/+/652179
Reviewed-by: Jorropo <jorropo.pgm@gmail.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
src/cmd/compile/internal/ssa/prove.go
test/fixedbugs/issue71852.go [new file with mode: 0644]

index c3948dc9b1d370b71620d3b1239f7ef152cc6624..6a8c2d58903d72280ad221247353826f7a071f19 100644 (file)
@@ -552,8 +552,9 @@ func (ft *factsTable) newLimit(v *Value, newLim limit) bool {
        }
 
        if lim.unsat() {
+               r := !ft.unsat
                ft.unsat = true
-               return true
+               return r
        }
 
        // Check for recursion. This normally happens because in unsatisfiable
diff --git a/test/fixedbugs/issue71852.go b/test/fixedbugs/issue71852.go
new file mode 100644 (file)
index 0000000..a0bc092
--- /dev/null
@@ -0,0 +1,23 @@
+// compile
+
+// Copyright 2025 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.
+
+package main
+
+import (
+       "math"
+)
+
+func main() {
+       test(2)
+}
+
+func test(i int) {
+       if i <= 0 {
+               return
+       }
+
+       _ = math.Pow10(i + 2)
+}