1
0
mirror of https://github.com/golang/go synced 2024-11-25 04:07:55 -07:00

assign nil to interface

SVN=123256
This commit is contained in:
Ken Thompson 2008-06-17 18:07:40 -07:00
parent 7131bf476c
commit c5bb50c9dc
2 changed files with 6 additions and 7 deletions

View File

@ -729,7 +729,7 @@ cgen_as(Node *nl, Node *nr, int op)
if(tl == T)
return;
if(nr == N) {
if(nr == N || isnil(nr)) {
if(isfat(tl)) {
/* clear a fat object */
if(debug['g'])

View File

@ -43,9 +43,8 @@ loop:
if(n->op != ONAME)
dynlineno = n->lineno; // for diagnostics
if(debug['w'] > 1 && top == Etop)
if(n->op != OLIST)
dump("walk-before", n);
if(debug['w'] > 1 && top == Etop && n->op != OLIST)
dump("walk-before", n);
t = T;
et = Txxx;
@ -218,7 +217,6 @@ loop:
walktype(l, Elv);
walktype(r, Erv);
if(l == N || l->type == T)
goto ret;
@ -233,6 +231,7 @@ loop:
}
goto ret;
}
l = ascompatee(n->op, &n->left, &n->right);
if(l != N)
*n = *reorder3(l);
@ -662,8 +661,8 @@ badt:
goto ret;
ret:
if(debug['w'] && top == Etop)
dump("walk-after", n);
if(debug['w'] && top == Etop && n != N)
dump("walk", n);
ullmancalc(n);
dynlineno = lno;