From: Russ Cox Date: Tue, 7 Jul 2009 04:37:29 +0000 (-0700) Subject: fix bug involving typed nil constants: X-Git-Tag: weekly.2009-11-06~1247 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=a14b28a24d1add0c260160f9fbb986597961b7eb;p=gostls13.git fix bug involving typed nil constants: interface = (*int)(nil) is not the same as interface = nil. package main func main() { var x interface{} = (*int)(nil); println(x.(*int)); } R=ken OCL=31232 CL=31232 --- diff --git a/src/cmd/gc/const.c b/src/cmd/gc/const.c index 5ce4ebee74..d45e6136a1 100644 --- a/src/cmd/gc/const.c +++ b/src/cmd/gc/const.c @@ -94,7 +94,7 @@ convlit1(Node *n, Type *t, int explicit) goto bad; if(et == TINTER) { - if(ct == CTNIL) { + if(ct == CTNIL && n->type == types[TNIL]) { n->type = t; return; }