go/test/fixedbugs/issue45948.go
Than McIntosh 66ce8aa88d cmd/compile: handle degenerate entry blocks in -N debug gen
The code that created DWARF debug var locations for input parameters
in the non-optimized case for regabi was not doing the right thing for
degenerate functions with infinite loops. Detect these cases and don't
try to emit the normal location data.

Fixes #45948.

Change-Id: I2717fc4bac2e03d5d850a6ec8a09ed05fed0c896
Reviewed-on: https://go-review.googlesource.com/c/go/+/316752
Trust: Than McIntosh <thanm@google.com>
Run-TryBot: Than McIntosh <thanm@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
2021-05-05 01:47:58 +00:00

17 lines
307 B
Go

// compile -N
// Copyright 2021 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.
// Issue 45948: assert in debug generation for degenerate
// function with infinite loop.
package p
func f(p int) {
L:
goto L
}