0
1
mirror of https://github.com/golang/go synced 2025-05-03 03:01:34 +00:00

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 

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>
This commit is contained in:
David Chase
2019-11-18 14:14:22 -05:00
parent 647741721c
commit 9bba63bbbe
3 changed files with 22 additions and 0 deletions
src/cmd
compile
internal
internal
test/fixedbugs

@ -0,0 +1,15 @@
// compile
// Copyright 2019 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 p
func f() {
for true {
if true {
continue
}
}
}