mirror of https://github.com/golang/go.git
missing error checking related to ([...]int){...}
R=ken OCL=35132 CL=35132
This commit is contained in:
parent
08eefec9d6
commit
e7f9452da5
|
|
@ -323,7 +323,7 @@ variter(NodeList *vl, Node *t, NodeList *el)
|
|||
declare(v, dclcontext);
|
||||
v->ntype = t;
|
||||
|
||||
if(e != N || funcdepth > 0) {
|
||||
if(e != N || funcdepth > 0 || isblank(v)) {
|
||||
if(funcdepth > 0)
|
||||
init = list(init, nod(ODCL, v, N));
|
||||
e = nod(OAS, v, e);
|
||||
|
|
|
|||
|
|
@ -1010,6 +1010,11 @@ ret:
|
|||
case TNIL:
|
||||
case TBLANK:
|
||||
break;
|
||||
case TARRAY:
|
||||
if(t->bound == -100) {
|
||||
yyerror("use of [...] array outside of array literal");
|
||||
t->bound = 1;
|
||||
}
|
||||
default:
|
||||
checkwidth(t);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue