Skip to content

Commit 76c8ff7

Browse files
committed
Fix HLSLParser: Always check preprocessor directive stack to be empty before using the top element
1 parent 64fe364 commit 76c8ff7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

vendor/hlslparser/src/HLSLParser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3614,7 +3614,7 @@ bool HLSLParser::ApplyPreprocessor(const char* fileName, const char* buffer, siz
36143614
isCodeActive.push(true);
36153615
m_tokenizer = HLSLTokenizer(fileName, buffer, length);
36163616
sourcePreprocessed.clear();
3617-
while (m_tokenizer.GetToken() != HLSLToken_EndOfStream)
3617+
while (m_tokenizer.GetToken() != HLSLToken_EndOfStream && !isCodeActive.empty())
36183618
{
36193619
bool addOriginalSource = true;
36203620

0 commit comments

Comments
 (0)