Skip to content

Commit

Permalink
Throw away our dummy usertypes from the parse phase.
Browse files Browse the repository at this point in the history
They are incorrect, and need to be correctly built during semantic analysis.
  • Loading branch information
icculus committed Jan 12, 2011
1 parent 0af8574 commit 99fec26
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions mojoshader_compiler.c
Expand Up @@ -3037,6 +3037,8 @@ static void parse_source(Context *ctx, const char *filename,

// !!! FIXME: check if (parser == NULL)...

SymbolScope *start_scope = ctx->usertypes.scope;

#if DEBUG_COMPILER_PARSER
ParseHLSLTrace(stdout, "COMPILER: ");
#endif
Expand Down Expand Up @@ -3165,6 +3167,10 @@ static void parse_source(Context *ctx, const char *filename,
pop_scope(ctx);
} while (tokenval != TOKEN_EOI);

// Clean out extra usertypes; they are dummies until semantic analysis.
while (ctx->usertypes.scope != start_scope)
pop_symbol(ctx, &ctx->usertypes);

ParseHLSLFree(parser, ctx->free, ctx->malloc_data);
preprocessor_end(pp);
} // parse_source
Expand Down

0 comments on commit 99fec26

Please sign in to comment.