From 8f12c5d2527f61183b2ae36aab224eefbf52086a Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Thu, 1 Sep 2022 22:44:32 +0300 Subject: [PATCH] Fix incorrect check for end of string when processing SPIR-V modules --- source/core/module.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/core/module.cpp b/source/core/module.cpp index 8c69cd7e..5a736914 100644 --- a/source/core/module.cpp +++ b/source/core/module.cpp @@ -320,7 +320,8 @@ SpirVModule *SpirVModule::specialize(const map &spec_values) const { unsigned word = *(op+i++); new_code.push_back(word); - if(!(word&(word>>8)&(word>>16)&(word>>24)&0xFF)) + // Strings are nul-terminated and nul-padded + if(!(word>>24)) break; } -- 2.43.0