Commit 7cd173a4 authored by Russ Cox's avatar Russ Cox

error about & at top level until it is safe

R=ken
OCL=17241
CL=17241
parent 1bf38484
......@@ -468,6 +468,8 @@ EXTERN int32 thunk;
EXTERN int exporting;
EXTERN int func;
/*
* y.tab.c
*/
......
......@@ -754,6 +754,8 @@ uexpr:
}
| '&' uexpr
{
if($2->op == OCONV && !func)
yyerror("& of composite literal at top level");
$$ = nod(OADDR, $2, N);
}
| '+' uexpr
......@@ -1179,11 +1181,13 @@ xfndcl:
{
maxarg = 0;
stksize = 0;
func++;
} fndcl fnbody
{
$$ = $3;
$$->nbody = $4;
funcbody($$);
func--;
}
fndcl:
......
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