Use strcmp for all of the extended instruction set checks in the disassembler (#2107)
authorRyan Harrison <rharrison@google.com>
Wed, 11 Mar 2020 07:00:13 +0000 (03:00 -0400)
committerGitHub <noreply@github.com>
Wed, 11 Mar 2020 07:00:13 +0000 (01:00 -0600)
Fixes #2106

* Convert memcmps to strcmps

SPIRV/disassemble.cpp

index 5b30a66..4faa89e 100644 (file)
@@ -481,9 +481,11 @@ void SpirvStream::disassembleInstruction(Id resultId, Id /*typeId*/, Op opCode,
             if (opCode == OpExtInst) {
                 ExtInstSet extInstSet = GLSL450Inst;
                 const char* name = idDescriptor[stream[word - 2]].c_str();
-                if (0 == memcmp("OpenCL", name, 6)) {
+                if (strcmp("OpenCL.std", name) == 0) {
                     extInstSet = OpenCLExtInst;
-                } else if (0 == memcmp("NonSemantic.DebugPrintf", name, 23)) {
+                } else if (strcmp("OpenCL.DebugInfo.100", name) == 0) {
+                    extInstSet = OpenCLExtInst;
+                } else if (strcmp("NonSemantic.DebugPrintf", name) == 0) {
                     extInstSet = NonSemanticDebugPrintfExtInst;
                 } else if (strcmp(spv::E_SPV_AMD_shader_ballot, name) == 0 ||
                            strcmp(spv::E_SPV_AMD_shader_trinary_minmax, name) == 0 ||