From 63ecf009ecbe6864511a64c6ddb8215aacae50a3 Mon Sep 17 00:00:00 2001 From: Evghenii Date: Tue, 17 Dec 2013 15:06:29 +0100 Subject: [PATCH] fix compilation for Visual Studio --- expr.cpp | 11 ++++++++--- expr.h | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) 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;