GNOME Bugzilla – Bug 681048
Evaluator 'remaining operands' error
Last modified: 2012-08-07 08:03:59 UTC
Le mercredi 01 août 2012 à 14:43 +0000, tom.cobb@diamond.ac.uk a écrit : > Ok, found the problem, but need help with the solution: > > --- src/arvevaluator.c (revision 80561) > +++ src/arvevaluator.c (working copy) > @@ -888,7 +888,7 @@ > status = ARV_EVALUATOR_STATUS_PARENTHESES_MISMATCH; > goto CLEANUP; > } > - arv_evaluator_token_free (token); > + //arv_evaluator_token_free (token); > arv_evaluator_token_free (operator_stack->data); > operator_stack = g_slist_delete_link (operator_stack, operator_stack); > } else { > > This arv_evaluator_token_free is freeing token, which is passed (as > previous_token) to arv_get_next_token. This causes > arv_evaluator_token_is_right_parenthesis(previous_token) to return > False, which causes "+" to be interpreted as a unary plus instead of a > binary plus, causing our remaining operands error. There is a similar > arv_evaluator_token_free in the code dealing with ",". Not quite sure > where we should free this token, but I guess it needs to be delayed! Thanks Tom. I guess the right solution would be to free the token just after the call to arv_get_next_token. Or store the ones that need to be freed in a garbage slist, and free this list and its content before exiting parse_expression.
[Evaluator::evaluate_as_int64] Expression = '(BINNING & 0x00060000)=0?((TO & 0xFF)+1):1' (BINNING & 0x00060000)=0?((TO & 0xFF)+1):1 [Evaluator::evaluate_as_int64] Parsing status = 0 (var) BINNING = 0 (int64) 393216 (operator) & (int64) 0 (operator) = (var) TO = 0 (int64) 255 (operator) & (int64) 1 (operator) plus (int64) 1 (operator) : (operator) ? [Evaluator::evaluate] Error 'remaining operands'
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.