From 2ed12a398dc7002d26d7177d4d5b2927dbac1a03 Mon Sep 17 00:00:00 2001 From: Mads Buvik Sandvei Date: Tue, 4 Aug 2020 01:46:54 +0000 Subject: [PATCH] addLineDirectivesAfterConditionalBlocks move check for npos to catch all npos --- components/shader/shadermanager.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/shader/shadermanager.cpp b/components/shader/shadermanager.cpp index 490c9d4383..be662990bb 100644 --- a/components/shader/shadermanager.cpp +++ b/components/shader/shadermanager.cpp @@ -34,6 +34,9 @@ namespace Shader foundPos = source.find_first_of("\n\r", foundPos); foundPos = source.find_first_not_of("\n\r", foundPos); + if (foundPos == std::string::npos) + break; + size_t lineDirectivePosition = source.rfind("#line", foundPos); int lineNumber; if (lineDirectivePosition != std::string::npos)