Skip to content

Commit

Permalink
Fixed parsing of DCL instructions.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Dec 10, 2008
1 parent e8d8fb7 commit 42412b5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions mojoshader_assembler.c
Expand Up @@ -343,16 +343,18 @@ static inline int tokenize(Context *ctx)
} // 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


Expand Down Expand Up @@ -1064,6 +1066,8 @@ static int parse_args_DCL(Context *ctx)
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;

Expand Down

0 comments on commit 42412b5

Please sign in to comment.