Commit c5bb50c9 authored by Ken Thompson's avatar Ken Thompson

assign nil to interface

SVN=123256
parent 7131bf47
...@@ -729,7 +729,7 @@ cgen_as(Node *nl, Node *nr, int op) ...@@ -729,7 +729,7 @@ cgen_as(Node *nl, Node *nr, int op)
if(tl == T) if(tl == T)
return; return;
if(nr == N) { if(nr == N || isnil(nr)) {
if(isfat(tl)) { if(isfat(tl)) {
/* clear a fat object */ /* clear a fat object */
if(debug['g']) if(debug['g'])
......
...@@ -43,8 +43,7 @@ loop: ...@@ -43,8 +43,7 @@ loop:
if(n->op != ONAME) if(n->op != ONAME)
dynlineno = n->lineno; // for diagnostics dynlineno = n->lineno; // for diagnostics
if(debug['w'] > 1 && top == Etop) if(debug['w'] > 1 && top == Etop && n->op != OLIST)
if(n->op != OLIST)
dump("walk-before", n); dump("walk-before", n);
t = T; t = T;
...@@ -218,7 +217,6 @@ loop: ...@@ -218,7 +217,6 @@ loop:
walktype(l, Elv); walktype(l, Elv);
walktype(r, Erv); walktype(r, Erv);
if(l == N || l->type == T) if(l == N || l->type == T)
goto ret; goto ret;
...@@ -233,6 +231,7 @@ loop: ...@@ -233,6 +231,7 @@ loop:
} }
goto ret; goto ret;
} }
l = ascompatee(n->op, &n->left, &n->right); l = ascompatee(n->op, &n->left, &n->right);
if(l != N) if(l != N)
*n = *reorder3(l); *n = *reorder3(l);
...@@ -662,8 +661,8 @@ badt: ...@@ -662,8 +661,8 @@ badt:
goto ret; goto ret;
ret: ret:
if(debug['w'] && top == Etop) if(debug['w'] && top == Etop && n != N)
dump("walk-after", n); dump("walk", n);
ullmancalc(n); ullmancalc(n);
dynlineno = lno; dynlineno = lno;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment