From 1cfc71b73e54b2c47687730ce007bdafaee39c92 Mon Sep 17 00:00:00 2001 From: John Kessenich Date: Fri, 8 May 2015 00:45:31 +0000 Subject: [PATCH] =?UTF-8?q?glslang->SPV:=20Fix=20addStringOperand=20so=20i?= =?UTF-8?q?t=20saves=20the=20string=20argument=20early,=20before=20the=20s?= =?UTF-8?q?tr=20parameter=20variable=20is=20modified.=20Otherwise=20you=20?= =?UTF-8?q?save=20a=20garbage=20string=20(buffer=20overrun=3F)=20because?= =?UTF-8?q?=20"str"=20has=20run=20past=20the=20terminating=20NUL.=20=20Con?= =?UTF-8?q?tributor:=20=C3=82=20Lei=20Zhang=20antiagainst@google.com?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@31108 e7fa87d3-cd2b-0410-9028-fcbf551c1848 --- SPIRV/spvIR.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/SPIRV/spvIR.h b/SPIRV/spvIR.h index c16df104..7ce6a56e 100644 --- a/SPIRV/spvIR.h +++ b/SPIRV/spvIR.h @@ -84,6 +84,7 @@ public: void addImmediateOperand(unsigned int immediate) { operands.push_back(immediate); } void addStringOperand(const char* str) { + originalString = str; string = new std::vector; unsigned int word; char* wordString = (char*)&word; @@ -108,8 +109,6 @@ public: *(wordPtr++) = 0; string->push_back(word); } - - originalString = str; } Op getOpCode() const { return opCode; } int getNumOperands() const { return operands.size(); }