Can't pass item->nameTarg->id into makeTargetItem. Just pass item->nameTarg and
authorthurston <thurston@052ea7fc-9027-0410-9066-f65837a77df0>
Thu, 26 Mar 2009 02:07:09 +0000 (02:07 +0000)
committerthurston <thurston@052ea7fc-9027-0410-9066-f65837a77df0>
Thu, 26 Mar 2009 02:07:09 +0000 (02:07 +0000)
derefence it after checking generatingSectionSubset. This bug crept in during
the merge of the frontend and backend and only showed up when using -V and -M
and the specified machine referenced another machine that didn't exist.

git-svn-id: http://svn.complang.org/ragel/trunk@766 052ea7fc-9027-0410-9066-f65837a77df0

ragel/xmlcodegen.cpp
ragel/xmlcodegen.h

index ed7b692..994fec7 100644 (file)
@@ -464,13 +464,14 @@ void BackendGen::makeText( GenInlineList *outList, InlineItem *item )
        outList->append( inlineItem );
 }
 
-void BackendGen::makeTargetItem( GenInlineList *outList, long entryId, GenInlineItem::Type type )
+void BackendGen::makeTargetItem( GenInlineList *outList, NameInst *nameTarg, 
+               GenInlineItem::Type type )
 {
        long targetState;
        if ( pd->generatingSectionSubset )
                targetState = -1;
        else {
-               EntryMapEl *targ = fsm->entryPoints.find( entryId );
+               EntryMapEl *targ = fsm->entryPoints.find( nameTarg->id );
                targetState = targ->value->alg.stateNum;
        }
 
@@ -627,19 +628,19 @@ void BackendGen::makeGenInlineList( GenInlineList *outList, InlineList *inList )
                        makeText( outList, item );
                        break;
                case InlineItem::Goto:
-                       makeTargetItem( outList, item->nameTarg->id, GenInlineItem::Goto );
+                       makeTargetItem( outList, item->nameTarg, GenInlineItem::Goto );
                        break;
                case InlineItem::GotoExpr:
                        makeSubList( outList, item->children, GenInlineItem::GotoExpr );
                        break;
                case InlineItem::Call:
-                       makeTargetItem( outList, item->nameTarg->id, GenInlineItem::Call );
+                       makeTargetItem( outList, item->nameTarg, GenInlineItem::Call );
                        break;
                case InlineItem::CallExpr:
                        makeSubList( outList, item->children, GenInlineItem::CallExpr );
                        break;
                case InlineItem::Next:
-                       makeTargetItem( outList, item->nameTarg->id, GenInlineItem::Next );
+                       makeTargetItem( outList, item->nameTarg, GenInlineItem::Next );
                        break;
                case InlineItem::NextExpr:
                        makeSubList( outList, item->children, GenInlineItem::NextExpr );
@@ -663,7 +664,7 @@ void BackendGen::makeGenInlineList( GenInlineList *outList, InlineList *inList )
                        outList->append( new GenInlineItem( InputLoc(), GenInlineItem::Targs ) );
                        break;
                case InlineItem::Entry:
-                       makeTargetItem( outList, item->nameTarg->id, GenInlineItem::Entry );
+                       makeTargetItem( outList, item->nameTarg, GenInlineItem::Entry );
                        break;
 
                case InlineItem::Hold:
index 16eb8e5..d20d6ea 100644 (file)
@@ -157,7 +157,7 @@ private:
        void makeSetAct( GenInlineList *outList, long lmId );
        void makeSubList( GenInlineList *outList, InlineList *inlineList, 
                        GenInlineItem::Type type );
-       void makeTargetItem( GenInlineList *outList, long targetId, GenInlineItem::Type type );
+       void makeTargetItem( GenInlineList *outList, NameInst *nameTarg, GenInlineItem::Type type );
        void makeExecGetTokend( GenInlineList *outList );
        void makeExports();
        void makeMachine();