public
/
ack.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0d246c0
)
Error check fragment rules which don't emit anything.
author
David Given
<dg@cowlark.com>
Thu, 29 Sep 2016 20:14:11 +0000
(22:14 +0200)
committer
David Given
<dg@cowlark.com>
Thu, 29 Sep 2016 20:14:11 +0000
(22:14 +0200)
util/mcgg/iburg.c
patch
|
blob
|
history
diff --git
a/util/mcgg/iburg.c
b/util/mcgg/iburg.c
index
0e8cad4
..
1fc0a7c
100644
(file)
--- a/
util/mcgg/iburg.c
+++ b/
util/mcgg/iburg.c
@@
-1014,6
+1014,15
@@
static void emitinsndata(Rule rules)
print("}\n\n");
}
+ else
+ {
+ /* This instruction has no code; make sure it's not a fragment. */
+ if (r->lhs->is_fragment)
+ {
+ yylineno = r->lineno;
+ yyerror("rule is a fragment, but doesn't emit anything");
+ }
+ }
r = r->link;
}