diff --git a/expr.cpp b/expr.cpp index 60d9ce66..9f75ab08 100644 --- a/expr.cpp +++ b/expr.cpp @@ -3544,9 +3544,14 @@ FunctionCallExpr::FunctionCallExpr(Expr *f, ExprList *a, SourcePos p, : Expr(p), isLaunch(il) { func = f; args = a; - launchCountExpr[0] = lce[0]; - launchCountExpr[1] = lce[1]; - launchCountExpr[2] = lce[2]; + if (lce != NULL) + { + launchCountExpr[0] = lce[0]; + launchCountExpr[1] = lce[1]; + launchCountExpr[2] = lce[2]; + } + else + launchCountExpr[0] = launchCountExpr[1] = launchCountExpr[2] = NULL; } diff --git a/expr.h b/expr.h index 0d46191b..e4d7e07b 100644 --- a/expr.h +++ b/expr.h @@ -247,7 +247,7 @@ class FunctionCallExpr : public Expr { public: FunctionCallExpr(Expr *func, ExprList *args, SourcePos p, bool isLaunch = false, - Expr *launchCountExpr[3] = (Expr*[3]){NULL, NULL, NULL}); + Expr *launchCountExpr[3] = NULL); llvm::Value *GetValue(FunctionEmitContext *ctx) const; llvm::Value *GetLValue(FunctionEmitContext *ctx) const;