HLSL: Fix #1903 Catch 0-argument case to constructors.
authorJohn Kessenich <cepheus@frii.com>
Wed, 18 Sep 2019 06:03:18 +0000 (00:03 -0600)
committerJohn Kessenich <cepheus@frii.com>
Wed, 18 Sep 2019 06:04:57 +0000 (00:04 -0600)
hlsl/hlslGrammar.cpp

index 45cf5d5..8ab1a90 100755 (executable)
@@ -3221,6 +3221,11 @@ bool HlslGrammar::acceptConstructor(TIntermTyped*& node)
             return false;
         }
 
+        if (arguments == nullptr) {
+            expected("one or more arguments");
+            return false;
+        }
+
         // hook it up
         node = parseContext.handleFunctionCall(arguments->getLoc(), constructorFunction, arguments);