Browse Source

Fixed variable init. Fixes #347.

woollybah 7 years ago
parent
commit
c2f05dbcb5
1 changed files with 3 additions and 2 deletions
  1. 3 2
      expr.bmx

+ 3 - 2
expr.bmx

@@ -134,9 +134,10 @@ Type TExpr
 				funcDecl.argDecls[i].Semant()
 			End If
 			
-			Local argExpr:TExpr = args[i]
+			If i < args.length And args[i]
+
+				Local argExpr:TExpr = args[i]
 
-			If i < args.length And argExpr
 				If TInvokeExpr(argExpr) And Not TInvokeExpr(argExpr).invokedWithBraces Then
 					If Not IsPointerType(funcDecl.argDecls[i].ty, TType.T_BYTE) And Not TFunctionPtrType(funcDecl.argDecls[i].ty) Then
 						Err "Unable to convert from '" + argExpr.exprType.ToString() + "()' to '" + funcDecl.argDecls[i].ty.ToString() + "'"