diff options
author | Than McIntosh <thanm@google.com> | 2021-05-04 16:18:56 -0400 |
---|---|---|
committer | Than McIntosh <thanm@google.com> | 2021-05-05 01:47:58 +0000 |
commit | 66ce8aa88d144338868b0d3ab8c895608a460750 (patch) | |
tree | 903f4f6119631b072a83fc71ecaa2fbf74c1d0e9 /test | |
parent | 4df662fb373480b5055e645120558bb536fae42c (diff) | |
download | go-66ce8aa88d144338868b0d3ab8c895608a460750.tar.gz go-66ce8aa88d144338868b0d3ab8c895608a460750.zip |
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>
Diffstat (limited to 'test')
-rw-r--r-- | test/fixedbugs/issue45948.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/fixedbugs/issue45948.go b/test/fixedbugs/issue45948.go new file mode 100644 index 0000000000..37f8e70e2b --- /dev/null +++ b/test/fixedbugs/issue45948.go @@ -0,0 +1,16 @@ +// 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 + +} |