Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed crash when pushing an empty string on the include_stack.
Turns out you can't just ignore some pushes.  :)
  • Loading branch information
icculus committed Jun 1, 2010
1 parent 90036c5 commit d268f63
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions mojoshader_preprocessor.c
Expand Up @@ -604,9 +604,6 @@ static int push_source(Context *ctx, const char *fname, const char *source,
unsigned int srclen, unsigned int linenum,
MOJOSHADER_includeClose close_callback)
{
if (srclen == 0)
return 1; // nothing to do: just pretend you did it.

IncludeState *state = get_include(ctx);
if (state == NULL)
return 0;
Expand Down Expand Up @@ -644,6 +641,7 @@ static int push_source(Context *ctx, const char *fname, const char *source,
static void pop_source(Context *ctx)
{
IncludeState *state = ctx->include_stack;
assert(state != NULL); // more pops than pushes!
if (state == NULL)
return;

Expand Down

0 comments on commit d268f63

Please sign in to comment.