From 8922ce7353f6b9d9f7ce7f794ae664d948f5448c Mon Sep 17 00:00:00 2001 From: John Kessenich Date: Mon, 24 Feb 2014 21:36:08 +0000 Subject: [PATCH] Fix bug 11736: Minor glslang compilation fixes: Correct "currentChar" logic for recently switched to unsigned size_t locations, and protect more pool guard code with #ifdef. git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@25512 e7fa87d3-cd2b-0410-9028-fcbf551c1848 --- glslang/Include/revision.h | 4 ++-- glslang/MachineIndependent/PoolAlloc.cpp | 4 ++++ glslang/MachineIndependent/Scan.h | 6 ++++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/glslang/Include/revision.h b/glslang/Include/revision.h index 3d25628..a0a39d2 100644 --- a/glslang/Include/revision.h +++ b/glslang/Include/revision.h @@ -9,5 +9,5 @@ // source have to figure out how to create revision.h just to get a build // going. However, if it is not updated, it can be a version behind. -#define GLSLANG_REVISION "25411" -#define GLSLANG_DATE "2014/02/18 19:47:20" +#define GLSLANG_REVISION "25511" +#define GLSLANG_DATE "2014/02/24 14:16:19" diff --git a/glslang/MachineIndependent/PoolAlloc.cpp b/glslang/MachineIndependent/PoolAlloc.cpp index 75c4972..26b371a 100644 --- a/glslang/MachineIndependent/PoolAlloc.cpp +++ b/glslang/MachineIndependent/PoolAlloc.cpp @@ -185,6 +185,7 @@ const unsigned char TAllocation::userDataFill = 0xcd; // void TAllocation::checkGuardBlock(unsigned char* blockMem, unsigned char val, const char* locText) const { +#ifdef GUARD_BLOCKS for (int x = 0; x < guardBlockSize; x++) { if (blockMem[x] != val) { const int maxSize = 80; @@ -196,6 +197,9 @@ void TAllocation::checkGuardBlock(unsigned char* blockMem, unsigned char val, co assert(0 && "PoolAlloc: Damage in guard block"); } } +#else + assert(guardBlockSize == 0); +#endif } diff --git a/glslang/MachineIndependent/Scan.h b/glslang/MachineIndependent/Scan.h index 8f6e9e4..6a8d0ff 100644 --- a/glslang/MachineIndependent/Scan.h +++ b/glslang/MachineIndependent/Scan.h @@ -93,9 +93,11 @@ public: do { --currentSource; } while (currentSource > 0 && lengths[currentSource] == 0); - currentChar = lengths[currentSource] - 1; - if (currentChar < 0) + if (lengths[currentSource] == 0) { + // set to 0 if we've backed up to the start of an empty string currentChar = 0; + } else + currentChar = lengths[currentSource] - 1; } if (peek() == '\n') --loc[currentSource].line; -- 2.7.4