]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: make a better bogus line for empty infinite loops
authorDavid Chase <drchase@google.com>
Mon, 18 Nov 2019 19:14:22 +0000 (14:14 -0500)
committerDavid Chase <drchase@google.com>
Tue, 19 Nov 2019 00:38:53 +0000 (00:38 +0000)
commit9bba63bbbe43ee6370367220feb46717ec50ea9c
tree262cea6a84d3ac76352f52378440d134d13fa6fb
parent647741721cd06efd0bd17ca7f7a85ae2264a6fe7
cmd/compile: make a better bogus line for empty infinite loops

The old recipe for making an infinite loop not be infinite
in the debugger could create an instruction (Prog) with a
line number not tied to any file (index == 0).  This caused
downstream failures in DWARF processing.

So don't do that.  Also adds a test, also adds a check+panic
to ensure that the next time this happens the error is less
mystifying.

Fixes #35652

Change-Id: I04f30bc94fdc4aef20dd9130561303ff84fd945e
Reviewed-on: https://go-review.googlesource.com/c/go/+/207613
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/cmd/compile/internal/gc/ssa.go
src/cmd/internal/src/xpos.go
test/fixedbugs/issue35652.go [new file with mode: 0644]