Navigation Menu

Skip to content

Commit

Permalink
Update res after operation only when it is optimized case
Browse files Browse the repository at this point in the history
Normally, res is updated before operation.
  • Loading branch information
kou committed Jun 19, 2013
1 parent deac1c0 commit dc52bd7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/expr.c
Expand Up @@ -2212,6 +2212,9 @@ grn_proc_call(grn_ctx *ctx, grn_obj *proc, int nargs, grn_obj *caller)
grn_obj *x, *y; \
\
POP2ALLOC1(x, y, res); \
if (y != res) { \
res->header.domain = x->header.domain; \
} \
ARITHMETIC_OPERATION_DISPATCH(x, y, res, \
integer8_operation, \
integer16_operation, \
Expand All @@ -2222,7 +2225,9 @@ grn_proc_call(grn_ctx *ctx, grn_obj *proc, int nargs, grn_obj *caller)
right_expression_check, \
text_operation, \
invalid_type_error); \
res->header.domain = x->header.domain; \
if (y == res) { \
res->header.domain = x->header.domain; \
} \
} while (0)

#define ARITHMETIC_UNARY_OPERATION_DISPATCH(integer_operation, \
Expand Down

0 comments on commit dc52bd7

Please sign in to comment.