Commit 7dd62cb3 authored by Ken Thompson's avatar Ken Thompson

2 minor bugs

R=r
OCL=20906
CL=20906
parent 57bd0da3
......@@ -701,13 +701,12 @@ testdclstack(void)
static void
redeclare(char *str, Sym *s)
{
if(s->block != block) {
s->block = block;
s->lastlineno = lineno;
return;
if(s->block == block) {
yyerror("%s %S redeclared in this block", str, s);
print(" previous declaration at %L\n", s->lastlineno);
}
yyerror("%s %S redeclared in this block %d", str, s, block);
print(" previous declaration at %L\n", s->lastlineno);
s->block = block;
s->lastlineno = lineno;
}
void
......
......@@ -1087,6 +1087,7 @@ nametype:
LATYPE
{
if($1->otype != T && $1->otype->etype == TANY)
if(strcmp(package, "PACKAGE") != 0)
yyerror("the any type is restricted");
$$ = oldtype($1);
}
......
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