[Groonga-commit] groonga/groonga at 6a922d0 [master] Fix a bug that "!XXX" may return inverted result

Back to archive index

Kouhei Sutou null+****@clear*****
Fri Oct 24 22:30:51 JST 2014


Kouhei Sutou	2014-10-24 22:30:51 +0900 (Fri, 24 Oct 2014)

  New Revision: 6a922d0bd47b407b37a94b7c5df5f97940c5e297
  https://github.com/groonga/groonga/commit/6a922d0bd47b407b37a94b7c5df5f97940c5e297

  Message:
    Fix a bug that "!XXX" may return inverted result
    
    It may be happened on big endian environment.

  Modified files:
    lib/expr.c

  Modified: lib/expr.c (+3 -2)
===================================================================
--- lib/expr.c    2014-10-24 22:10:24 +0900 (47406ba)
+++ lib/expr.c    2014-10-24 22:30:51 +0900 (f3d0cf2)
@@ -4039,10 +4039,11 @@ grn_expr_exec(grn_ctx *ctx, grn_obj *expr, int nargs)
       case GRN_OP_NOT :
         {
           grn_obj *value;
+          grn_bool value_boolean;
           POP1ALLOC1(value, res);
+          GRN_TRUEP(ctx, value, value_boolean);
           grn_obj_reinit(ctx, res, GRN_DB_BOOL, 0);
-          grn_obj_cast(ctx, value, res, GRN_FALSE);
-          GRN_BOOL_SET(ctx, res, !GRN_BOOL_VALUE(res));
+          GRN_BOOL_SET(ctx, res, !value_boolean);
         }
         code++;
         break;
-------------- next part --------------
HTML����������������������������...
下载 



More information about the Groonga-commit mailing list
Back to archive index