Patch for "unresolvable state reference crash" bug

Ross Thomas halfacan... at gmail.com
Sun May 11 18:09:07 UTC 2008


To duplicate, have an action fgoto a label that does not exist. The
below patch adds a check for this.

If this isn't the correct way to report a bug or submit a patch please
let me know.

-Ross

diff -urN trunk/ragel/parsedata.cpp trunk-unresolvable-state-reference/
ragel/parsedata.cpp
--- trunk/ragel/parsedata.cpp	2008-05-11 10:07:06.000000000 -0700
+++ trunk-unresolvable-state-reference/ragel/parsedata.cpp	2008-05-11
10:37:42.000000000 -0700
@@ -734,6 +734,8 @@
 			case InlineItem::Call: case InlineItem::Next: {
 				/* Resolve, pass action for local search. */
 				NameInst *target = resolveStateRef( *item->nameRef, item->loc,
action );
+				if ( 0 == target )
+					break;

 				/* Check if the target goes into a longest match. */
 				NameInst *search = target->parent;



More information about the ragel-users mailing list