Commit fb22b69f by John Kessenich

PP: Partially address issue #738: handle premature end of argument when token pasting.

parent 45c1b5b9
......@@ -5,7 +5,10 @@ ERROR: 0:40: '##' : unexpected location; end of replacement list
ERROR: 0:49: '##' : combined tokens are too long
ERROR: 0:52: '##' : not supported for these tokens
ERROR: 0:69: '##' : combined token is invalid
ERROR: 5 compilation errors. No code generated.
ERROR: 0:82: 'macro expansion' : Too few args in Macro rec
ERROR: 0:82: '##' : unexpected location
ERROR: 0:82: '##' : unexpected location
ERROR: 8 compilation errors. No code generated.
Shader version: 450
......
......@@ -77,3 +77,6 @@ uniform M_OUTER(argPaste);
#define M_NEST2(q) int q ## suff
#define M_OUTER2(p) M_NEST2(p ## 20)
uniform M_OUTER2(argPaste);
#define rec(x)##
rec(rec())
\ No newline at end of file
......@@ -2,5 +2,5 @@
// For the version, it uses the latest git tag followed by the number of commits.
// For the date, it uses the current date (when then script is run).
#define GLSLANG_REVISION "Overload400-PrecQual.1858"
#define GLSLANG_REVISION "Overload400-PrecQual.1861"
#define GLSLANG_DATE "28-Feb-2017"
......@@ -986,6 +986,8 @@ TPpContext::TokenStream* TPpContext::PrescanMacroArg(TokenStream& arg, TPpToken*
int token;
while ((token = scanToken(ppToken)) != tMarkerInput::marker && token != EndOfInput) {
token = tokenPaste(token, *ppToken);
if (token == tMarkerInput::marker || token == EndOfInput)
break;
if (token == PpAtomIdentifier && MacroExpand(ppToken, false, newLineOkay) != 0)
continue;
expandedArg->putToken(token, ppToken);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment