From d63b61a78473ff37699307d71f9bfc501de58e59 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Wed, 11 Feb 2009 21:29:23 -0500 Subject: [PATCH] Set an error in the preprocessor if there's an incomplete multiline comment. --- mojoshader_preprocessor.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mojoshader_preprocessor.c b/mojoshader_preprocessor.c index 6687d98e..6eab4225 100644 --- a/mojoshader_preprocessor.c +++ b/mojoshader_preprocessor.c @@ -350,6 +350,12 @@ static inline const char *_preprocessor_nexttoken(Preprocessor *_ctx, continue; // pick up again after parent's #include line. } // if + else if (token == TOKEN_PP_INCOMPLETE_COMMENT) + { + fail(ctx, "Incomplete multiline comment"); + continue; // !!! FIXME: we should probably return TOKEN_ERROR or something. + } // else if + *_token = token; *_len = (unsigned int) (state->source - state->token); return state->token;