]> git.tdb.fi Git - libs/gl.git/commitdiff
Fix incorrect check for end of string when processing SPIR-V modules
authorMikko Rasa <tdb@tdb.fi>
Thu, 1 Sep 2022 19:44:32 +0000 (22:44 +0300)
committerMikko Rasa <tdb@tdb.fi>
Thu, 1 Sep 2022 19:44:32 +0000 (22:44 +0300)
source/core/module.cpp

index 8c69cd7e256673bb1887c61a9f82da31539f2cfb..5a7369147c104558f89eebf717ef87d840db3cb5 100644 (file)
@@ -320,7 +320,8 @@ SpirVModule *SpirVModule::specialize(const map<string, int> &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;
                                }