mirror of
https://github.com/golang/go
synced 2024-11-15 03:10:22 -07:00
5e4a0cdde3
This merge involved two merge conflicts: 1. walk's ascompatee code has been substantially refactored on dev.regabi, so CL 285633 is ported to the new style. 2. The os.TestDirFS workaround added in CL 286213 can be removed now that #42637 has been fixed by CL 285720. Conflicts: - src/cmd/compile/internal/gc/walk.go - src/os/os_test.go Merge List: + 2021-01-25bf0f7c9d78
doc/go1.16: mention os.DirFS in os section + 2021-01-25deaf29a8a8
cmd/compile: fix order-of-assignment issue w/ defers + 2021-01-25ad2ca26a52
doc/go1.16: mention os.DirEntry and types moved from os to io/fs + 2021-01-25a51921fa5b
doc/go1.16: mention new testing/iotest functions + 2021-01-25e6b6d107f7
doc/go1.16: mention deprecation of io/ioutil + 2021-01-2596a276363b
doc/go1.16: mention go/build changes + 2021-01-253d85c69a0b
html/template: revert "avoid race when escaping updates template" + 2021-01-2554514c6b28
cmd/go: fix TestScript/cgo_path, cgo_path_space when CC set + 2021-01-256de8443f3b
doc/asm: add a section on go_asm.h, clean up go_tls.h section + 2021-01-2554b251f542
lib/time, time/tzdata: update tzdata to 2021a + 2021-01-25ff82cc971a
os: force consistent mtime before running fstest on directory on Windows + 2021-01-25044f937a73
doc/go1.16: fix WalkDir and Walk links + 2021-01-23b634f5d97a
doc/go1.16: add crypto/x509 memory optimization + 2021-01-239897655c61
doc/go1.16: reword ambiguously parsable sentence + 2021-01-23cd99385ff4
cmd/internal/obj/arm64: fix VMOVQ instruction encoding error + 2021-01-2366ee8b158f
runtime: restore cgo_import_dynamic for libc.so on openbsd + 2021-01-2225c39e4fb5
io/ioutil: fix example test for WriteFile to allow it to run in the playground + 2021-01-22eb21b31e48
runtime: define dummy msanmove + 2021-01-223a778ff50f
runtime: check for g0 stack last in signal handler + 2021-01-22a2cef9b544
cmd/go: don't lookup the path for CC when invoking cgo Change-Id: I651949f9eb18b57e3c996c4f3b2b3bf458bc5d97
46 lines
593 B
Go
46 lines
593 B
Go
// run
|
|
|
|
// 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.
|
|
|
|
package main
|
|
|
|
func main() {
|
|
if f() {
|
|
panic("FAIL")
|
|
}
|
|
if bad, _ := g(); bad {
|
|
panic("FAIL")
|
|
}
|
|
if bad, _ := h(); bad {
|
|
panic("FAIL")
|
|
}
|
|
}
|
|
|
|
func f() (bad bool) {
|
|
defer func() {
|
|
recover()
|
|
}()
|
|
var p *int
|
|
bad, _ = true, *p
|
|
return
|
|
}
|
|
|
|
func g() (bool, int) {
|
|
defer func() {
|
|
recover()
|
|
}()
|
|
var p *int
|
|
return true, *p
|
|
}
|
|
|
|
|
|
func h() (_ bool, _ int) {
|
|
defer func() {
|
|
recover()
|
|
}()
|
|
var p *int
|
|
return true, *p
|
|
}
|