mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/gc: correct liveness for func ending in panic
The registerization code needs the function to end in a RET, even if that RET is actually unreachable. The liveness code needs to avoid such unreachable RETs. It had a special case for final RET after JMP, but no case for final RET after UNDEF. Instead of expanding the special cases, let fixjmp - which already knows what is and is not reachable definitively - mark the unreachable RET so that the liveness code can identify it. TBR=iant CC=golang-codereviews https://golang.org/cl/63680043
This commit is contained in:
parent
02ae91f342
commit
ab9e8d068a
3 changed files with 18 additions and 6 deletions
|
|
@ -113,3 +113,11 @@ func f9() bool {
|
|||
x := i9
|
||||
return x != 99
|
||||
}
|
||||
|
||||
// liveness formerly confused by UNDEF followed by RET,
|
||||
// leading to "live at entry to f10: ~r1" (unnamed result).
|
||||
|
||||
func f10() string {
|
||||
panic(1)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue