Skip to content
Commit 8a471fe1 authored by Timothy Arceri's avatar Timothy Arceri Committed by Andres Gomez
Browse files

glsl: fixer lexer for unreachable defines

If we have something like:

   #ifdef NOT_DEFINED
   #define A_MACRO(x) \
	if (x)
   #endif

The # on the #define is not skipped but the define itself is so
this then gets recognised as #if.

Until 28a3731e this didn't happen because we ended up in
<HASH>{NONSPACE} where BEGIN INITIAL was called stopping the
problem from happening.

This change makes sure we never call RETURN_TOKEN_NEVER_SKIP for
if/else/endif when processing a define.

Cc: Ian Romanick <idr@freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107772


Tested-By: default avatarEero Tamminen <eero.t.tamminen@intel.com>
Reviewed-by: default avatarIan Romanick <ian.d.romanick@intel.com>
(cherry picked from commit b9fe8ff2)
parent 4ddc689d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment