/
githubmirror
/
go
Обзор
Документация
Войти
/
githubmirror
/
go
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
test/fixedbugs/issue18725.go
24 строки
415 B
Keith Randall
cmd/compile: don't use nilcheck information until the next block
20 янв 2017, 23:21
20 янв 2017, 23:21
256a605
Код
Авторство
О чём код?
// run // Copyright 2017 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 import "os" func panicWhenNot(cond bool) { if cond { os.Exit(0) } else { panic("nilcheck elim failed") } } func main() { e := (*string)(nil) panicWhenNot(e == e) // Should never reach this line. panicWhenNot(*e == *e) }