1// run
2
3// Copyright 2017 The Go Authors. All rights reserved.
4// Use of this source code is governed by a BSD-style
5// license that can be found in the LICENSE file.
6
7// Issue 19246: Failed to evaluate some zero-sized values
8// when converting them to interfaces.
9
10package main
11
12import "os"
13
14type B struct{}
15
16//go:noinline
17func f(i interface{}) {}
18
19func main() {
20	defer func() {
21		if recover() == nil {
22			println("expected nil pointer dereference panic")
23			os.Exit(1)
24		}
25	}()
26	var b *B
27	f(*b)
28}
29