delve/_fixtures/badflags.go
Alessandro Arzilli b53fcbe43a
proc: fix RFLAGS corruption after call injection on amd64 (#3002)
debugCallV2 for amd64 has a bug where it corrupts the flags registers
every time it is called, this commit works around that problem by
restoring flags one extra time to its original value after stepping out
of debugCallV2.

Fixes #2985
2022-05-05 08:41:40 -07:00

20 lines
192 B
Go

package main
import (
"fmt"
"os"
)
func g() {
}
func main() {
g()
a := os.Args[1] == "1"
if a {
fmt.Printf("true branch %v\n", a)
} else {
fmt.Printf("false branch %v\n", a)
}
}