Fix HLSLParser: Always check preprocessor directive stack to be empty before using the top element

This commit is contained in:
Kai Blaschke
2026-04-24 10:33:34 +02:00
parent 64fe364738
commit 76c8ff7e8a

View File

@ -3614,7 +3614,7 @@ bool HLSLParser::ApplyPreprocessor(const char* fileName, const char* buffer, siz
isCodeActive.push(true);
m_tokenizer = HLSLTokenizer(fileName, buffer, length);
sourcePreprocessed.clear();
while (m_tokenizer.GetToken() != HLSLToken_EndOfStream)
while (m_tokenizer.GetToken() != HLSLToken_EndOfStream && !isCodeActive.empty())
{
bool addOriginalSource = true;