From ab8622cbba4622e9004f007875cfc9f329bf608f Mon Sep 17 00:00:00 2001 From: Pedro Date: Wed, 12 Nov 2014 11:18:43 +0100 Subject: [PATCH] implemented expr null constructor --- deploy_to_hyrise.sh | 2 +- src/lib/Expr.h | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/deploy_to_hyrise.sh b/deploy_to_hyrise.sh index fa54ce7..ab5e592 100755 --- a/deploy_to_hyrise.sh +++ b/deploy_to_hyrise.sh @@ -3,7 +3,7 @@ # Usage: deploy_to_hyrise.sh path/to/hyrise.git -BUILD_PATH=$(readlink -f $(dirname $0))/src/build +BUILD_PATH=$(readlink -f $(dirname $0))/build HYRISE_PATH=$1 diff --git a/src/lib/Expr.h b/src/lib/Expr.h index 32a9bd0..97528d3 100644 --- a/src/lib/Expr.h +++ b/src/lib/Expr.h @@ -50,7 +50,7 @@ struct Expr { - Expr(ExprType type) : type(type) {}; + Expr(ExprType type) : type(type), expr(NULL), expr2(NULL), name(NULL), table(NULL), alias(NULL) {}; // Interesting side-effect: // Making the destructor virtual causes segmentation faults @@ -83,6 +83,7 @@ struct Expr { }; // Zero initializes an Expr object and assigns it to a space in the heap +// For Hyrise we still had to put in the explicit NULL constructor // http://www.ex-parrot.com/~chris/random/initialise.html #define ALLOC_EXPR(var, type) \ Expr* var; \ @@ -90,7 +91,8 @@ struct Expr { Expr zero = {type}; \ var = (Expr*)malloc(sizeof *var); \ *var = zero; \ - } while(0); + } while(0); + } // namespace hsql