]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: change the "bogus line" to be 1
authorDavid Chase <drchase@google.com>
Fri, 17 Jan 2020 17:03:55 +0000 (12:03 -0500)
committerDavid Chase <drchase@google.com>
Fri, 17 Jan 2020 23:14:48 +0000 (23:14 +0000)
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>
src/cmd/compile/internal/ssa/testdata/infloop.dlv-opt.nexts
src/cmd/internal/src/pos.go
src/cmd/objdump/testdata/fmthello.go

index 19496de6600c62cd49800d62737a9f093863845b..0b9f06f85dad54b280512c6474d94954f139714f 100644 (file)
@@ -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 {
index 60c7c91cde41f7b4e234f067b4166a7f9572edbf..861d9188b13d6ddce8e2ee3a81b2662fe921d0fd 100644 (file)
@@ -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
index e98268199d80ca184461aa32c370be43dfdc0caf..fd16ebee1b0bf2c546026be315a780b12458ac69 100644 (file)
@@ -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