diff options
Diffstat (limited to 'src/analysis/scan/exprs/arithmetic.c')
-rw-r--r-- | src/analysis/scan/exprs/arithmetic.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/analysis/scan/exprs/arithmetic.c b/src/analysis/scan/exprs/arithmetic.c index 0c01d2a..06cfc48 100644 --- a/src/analysis/scan/exprs/arithmetic.c +++ b/src/analysis/scan/exprs/arithmetic.c @@ -56,7 +56,7 @@ static void g_scan_arithmetic_operation_finalize(GScanArithmeticOperation *); static bool g_scan_arithmetic_operation_compare_rich(const GScanArithmeticOperation *, const GScanArithmeticOperation *, RichCmpOperation, bool *); /* Réduit une expression à une forme plus simple. */ -static ScanReductionState g_scan_arithmetic_operation_reduce(GScanArithmeticOperation *, GScanContext *, GScanScope *, GScanExpression **); +static ScanReductionState g_scan_arithmetic_operation_reduce(const GScanArithmeticOperation *, GScanContext *, GScanScope *, GScanExpression **); @@ -207,7 +207,8 @@ bool g_scan_arithmetic_operation_create(GScanArithmeticOperation *op, Arithmetic { bool result; /* Bilan à retourner */ - result = true; + result = g_scan_expression_create(G_SCAN_EXPRESSION(op), SRS_PENDING); + if (!result) goto exit; op->operator = operator; @@ -217,6 +218,8 @@ bool g_scan_arithmetic_operation_create(GScanArithmeticOperation *op, Arithmetic op->right = right; g_object_ref(G_OBJECT(op->right)); + exit: + return result; } @@ -290,7 +293,7 @@ static bool g_scan_arithmetic_operation_compare_rich(const GScanArithmeticOperat * * ******************************************************************************/ -static ScanReductionState g_scan_arithmetic_operation_reduce(GScanArithmeticOperation *expr, GScanContext *ctx, GScanScope *scope, GScanExpression **out) +static ScanReductionState g_scan_arithmetic_operation_reduce(const GScanArithmeticOperation *expr, GScanContext *ctx, GScanScope *scope, GScanExpression **out) { ScanReductionState result; /* Etat synthétisé à retourner */ GScanExpression *new_left; /* Expression réduite (gauche) */ |