Kaynağa Gözat

Fix potential NULL dereference

Johan Mattsson 2 yıl önce
ebeveyn
işleme
9cdfc5a511

+ 3 - 3
glslang/MachineIndependent/ParseContextBase.cpp

@@ -235,12 +235,12 @@ bool TParseContextBase::lValueErrorCheck(const TSourceLoc& loc, const char* op,
 // Test for and give an error if the node can't be read from.
 void TParseContextBase::rValueErrorCheck(const TSourceLoc& loc, const char* op, TIntermTyped* node)
 {
-    TIntermBinary* binaryNode = node->getAsBinaryNode();
-    const TIntermSymbol* symNode = node->getAsSymbolNode();
-
     if (! node)
         return;
 
+    TIntermBinary* binaryNode = node->getAsBinaryNode();
+    const TIntermSymbol* symNode = node->getAsSymbolNode();
+
     if (node->getQualifier().isWriteOnly()) {
         const TIntermTyped* leftMostTypeNode = TIntermediate::findLValueBase(node, true);