Commit 7d9795e5 by Richard Stallman

(lookup_label): Return 0 if not within a function.

From-SVN: r3324
parent 3f7531db
...@@ -2226,6 +2226,13 @@ lookup_label (id) ...@@ -2226,6 +2226,13 @@ lookup_label (id)
{ {
register tree decl = IDENTIFIER_LABEL_VALUE (id); register tree decl = IDENTIFIER_LABEL_VALUE (id);
if (current_function_decl == 0)
{
error ("label %s referenced outside of any function",
IDENTIFIER_POINTER (id));
return 0;
}
/* Use a label already defined or ref'd with this name. */ /* Use a label already defined or ref'd with this name. */
if (decl != 0) if (decl != 0)
{ {
......
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