mojoshader_assembler.c
changeset 490 14b6586d9c43
parent 489 414b70b829d7
child 491 bcc3c215807a
--- a/mojoshader_assembler.c	Wed Dec 10 04:24:28 2008 -0500
+++ b/mojoshader_assembler.c	Wed Dec 10 05:04:52 2008 -0500
@@ -343,16 +343,18 @@
 } // tokenize
 
 
-static inline void pushback(Context *ctx)
+static inline int pushback(Context *ctx)
 {
     #if DEBUG_TOKENIZER
     printf("PUSHBACK\n");
     #endif
 
     if (ctx->pushedback)
-        fail(ctx, "BUG: Double pushback in parser");
+        return fail(ctx, "BUG: Double pushback in parser");
     else
         ctx->pushedback = 1;
+
+    return NOFAIL;
 } // pushback
 
 
@@ -1064,6 +1066,8 @@
         return FAIL;
     else if (strcmp(ctx->token, " ") != 0)
         return fail(ctx, "Expected register");
+    else if (pushback(ctx) == FAIL)  // parse_destination_token() wants the ' '
+        return FAIL;
     else if (parse_destination_token(ctx, &ctx->dest_arg) == FAIL)
         return FAIL;