A round of increasing robustness against buffer overruns.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@21917 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
parent
7408a69952
commit
00f605b930
11 changed files with 98 additions and 32 deletions
|
|
@ -81,7 +81,7 @@ bool ParseBinary(bool /* preVisit */, TIntermBinary* node, TIntermTraverser* it)
|
|||
TStorageQualifier qualifier = node->getType().getQualifier().storage;
|
||||
|
||||
if (qualifier != EvqConst) {
|
||||
const int maxSize = 200;
|
||||
const int maxSize = GlslangMaxTypeLength + 50;
|
||||
char buf[maxSize];
|
||||
snprintf(buf, maxSize, "'constructor' : assigning non-constant to %s", oit->type.getCompleteString().c_str());
|
||||
oit->infoSink.info.message(EPrefixError, buf, node->getLine());
|
||||
|
|
@ -99,7 +99,7 @@ bool ParseUnary(bool /* preVisit */, TIntermUnary* node, TIntermTraverser* it)
|
|||
{
|
||||
TConstTraverser* oit = static_cast<TConstTraverser*>(it);
|
||||
|
||||
const int maxSize = 200;
|
||||
const int maxSize = GlslangMaxTypeLength + 50;
|
||||
char buf[maxSize];
|
||||
snprintf(buf, maxSize, "'constructor' : assigning non-constant to '%s'", oit->type.getCompleteString().c_str());
|
||||
oit->infoSink.info.message(EPrefixError, buf, node->getLine());
|
||||
|
|
@ -113,7 +113,7 @@ bool ParseAggregate(bool /* preVisit */, TIntermAggregate* node, TIntermTraverse
|
|||
TConstTraverser* oit = static_cast<TConstTraverser*>(it);
|
||||
|
||||
if (!node->isConstructor() && node->getOp() != EOpComma) {
|
||||
const int maxSize = 200;
|
||||
const int maxSize = GlslangMaxTypeLength + 50;
|
||||
char buf[maxSize];
|
||||
snprintf(buf, maxSize, "'constructor' : assigning non-constant to '%s'", oit->type.getCompleteString().c_str());
|
||||
oit->infoSink.info.message(EPrefixError, buf, node->getLine());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue