From: Wolfgang Bumiller Date: Tue, 12 Nov 2013 13:39:25 +0000 (+0100) Subject: folder: fix -fperl-logic X-Git-Tag: xonotic-v0.8.0~98 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=de12a24bc929551aa2eb2cbbe2a991dfddc076f0;p=xonotic%2Fgmqcc.git folder: fix -fperl-logic --- diff --git a/fold.c b/fold.c index cd827bc..735758c 100644 --- a/fold.c +++ b/fold.c @@ -563,8 +563,10 @@ static GMQCC_INLINE ast_expression *fold_op_rshift(fold_t *fold, ast_value *a, a static GMQCC_INLINE ast_expression *fold_op_andor(fold_t *fold, ast_value *a, ast_value *b, float expr) { if (fold_can_2(a, b)) { if (OPTS_FLAG(PERL_LOGIC)) { - if (fold_immediate_true(fold, a)) - return (ast_expression*)b; + if (expr) + return (fold_immediate_true(fold, a)) ? (ast_expression*)a : (ast_expression*)b; + else + return (fold_immediate_true(fold, a)) ? (ast_expression*)b : (ast_expression*)a; } else { return fold_constgen_float ( fold,