Commit 69762564 by John Kessenich

A bunch of semantic checks were missing for binary arithmetic operations.…

A bunch of semantic checks were missing for binary arithmetic operations. Refactor the "promote" logic to fix these. git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@21784 e7fa87d3-cd2b-0410-9028-fcbf551c1848
parent 0f359f0e
...@@ -563,6 +563,7 @@ public: ...@@ -563,6 +563,7 @@ public:
void setArrayInformationType(TType* t) { arrayInformationType = t; } void setArrayInformationType(TType* t) { arrayInformationType = t; }
TType* getArrayInformationType() { return arrayInformationType; } TType* getArrayInformationType() { return arrayInformationType; }
virtual bool isVector() const { return vectorSize > 1; } virtual bool isVector() const { return vectorSize > 1; }
virtual bool isScalar() const { return vectorSize == 1; }
const char* getBasicString() const { const char* getBasicString() const {
return TType::getBasicString(basicType); return TType::getBasicString(basicType);
} }
......
...@@ -360,6 +360,7 @@ public: ...@@ -360,6 +360,7 @@ public:
virtual bool isMatrix() const { return type.isMatrix(); } virtual bool isMatrix() const { return type.isMatrix(); }
virtual bool isArray() const { return type.isArray(); } virtual bool isArray() const { return type.isArray(); }
virtual bool isVector() const { return type.isVector(); } virtual bool isVector() const { return type.isVector(); }
virtual bool isScalar() const { return type.isScalar(); }
TString getCompleteString() const { return type.getCompleteString(); } TString getCompleteString() const { return type.getCompleteString(); }
protected: protected:
......
...@@ -416,7 +416,7 @@ bool TParseContext::constErrorCheck(TIntermTyped* node) ...@@ -416,7 +416,7 @@ bool TParseContext::constErrorCheck(TIntermTyped* node)
// //
bool TParseContext::integerErrorCheck(TIntermTyped* node, const char* token) bool TParseContext::integerErrorCheck(TIntermTyped* node, const char* token)
{ {
if ((node->getBasicType() == EbtInt || node->getBasicType() == EbtUint) && node->getVectorSize() == 1 && ! node->isArray()) if ((node->getBasicType() == EbtInt || node->getBasicType() == EbtUint) && node->isScalar() && ! node->isArray())
return false; return false;
error(node->getLine(), "scalar integer expression required", token, ""); error(node->getLine(), "scalar integer expression required", token, "");
......
...@@ -601,7 +601,6 @@ function_call ...@@ -601,7 +601,6 @@ function_call
} }
; ;
// TODO: clean up: can we eliminate function_call_or_method and function_call_generic?
function_call_or_method function_call_or_method
: function_call_generic { : function_call_generic {
$$ = $1; $$ = $1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment