aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDavid Chase <drchase@google.com>2020-01-17 12:03:55 -0500
committerDavid Chase <drchase@google.com>2020-01-17 23:14:48 +0000
commitc112289ee4141ebc31db50328c355b01278b987b (patch)
tree4dd6f258129a4c09e2ea63270b5dbf1826c519a5 /src
parent316fd8cc4a7fab2e1bb45848bc30ea8b8a0b231a (diff)
downloadgo-c112289ee4141ebc31db50328c355b01278b987b.tar.xz
cmd/compile: change the "bogus line" to be 1
The previous value was "too bogus" and caused objdump to crash. Updated infinite loop test results (only run if -args -f) in ssa/debug_test.go Probably also fixes #36621 but that bug needs more info to tell for certain. Fixes #36570 Change-Id: I51144641d25d559308a98d726d87806bd340cc5a Reviewed-on: https://go-review.googlesource.com/c/go/+/215297 Run-TryBot: David Chase <drchase@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
Diffstat (limited to 'src')
-rw-r--r--src/cmd/compile/internal/ssa/testdata/infloop.dlv-opt.nexts8
-rw-r--r--src/cmd/internal/src/pos.go2
-rw-r--r--src/cmd/objdump/testdata/fmthello.go6
3 files changed, 11 insertions, 5 deletions
diff --git a/src/cmd/compile/internal/ssa/testdata/infloop.dlv-opt.nexts b/src/cmd/compile/internal/ssa/testdata/infloop.dlv-opt.nexts
index 19496de660..0b9f06f85d 100644
--- a/src/cmd/compile/internal/ssa/testdata/infloop.dlv-opt.nexts
+++ b/src/cmd/compile/internal/ssa/testdata/infloop.dlv-opt.nexts
@@ -2,11 +2,11 @@
6: func test() {
8: go func() {}()
10: for {
-1048575:
+1: package main
10: for {
-1048575:
+1: package main
10: for {
-1048575:
+1: package main
10: for {
-1048575:
+1: package main
10: for {
diff --git a/src/cmd/internal/src/pos.go b/src/cmd/internal/src/pos.go
index 60c7c91cde..861d9188b1 100644
--- a/src/cmd/internal/src/pos.go
+++ b/src/cmd/internal/src/pos.go
@@ -305,7 +305,7 @@ type lico uint32
// because they have almost no interaction with other uses of the position.
const (
lineBits, lineMax = 20, 1<<lineBits - 2
- bogusLine = 1<<lineBits - 1 // Not a line number; used to disrupt infinite loops
+ bogusLine = 1 // Used to disrupt infinite loops to prevent debugger looping
isStmtBits, isStmtMax = 2, 1<<isStmtBits - 1
xlogueBits, xlogueMax = 2, 1<<xlogueBits - 1
colBits, colMax = 32 - lineBits - xlogueBits - isStmtBits, 1<<colBits - 1
diff --git a/src/cmd/objdump/testdata/fmthello.go b/src/cmd/objdump/testdata/fmthello.go
index e98268199d..fd16ebee1b 100644
--- a/src/cmd/objdump/testdata/fmthello.go
+++ b/src/cmd/objdump/testdata/fmthello.go
@@ -4,9 +4,15 @@ import "fmt"
func main() {
Println("hello, world")
+ if flag {
+ for {
+ }
+ }
}
//go:noinline
func Println(s string) {
fmt.Println(s)
}
+
+var flag bool