Permalink
Browse files

Clear (o).w first for MRB_WORD_BOXING; ref #3396

  • Loading branch information...
matz committed Jan 25, 2017
1 parent b3ce364 commit 51d7a69ab04d1e58618c419543744783de0a9670
Showing with 3 additions and 3 deletions.
  1. +3 −3 include/mruby/boxing_word.h
@@ -95,13 +95,13 @@ mrb_type(mrb_value o)
#define mrb_undef_p(o) ((o).w == MRB_Qundef)
#define mrb_nil_p(o) ((o).w == MRB_Qnil)
#define BOXWORD_SET_VALUE(o, ttt, attr, v) do {\
#define BOXWORD_SET_VALUE(o, ttt, attr, v) do { \
switch (ttt) {\
case MRB_TT_FALSE: (o).w = (v) ? MRB_Qfalse : MRB_Qnil; break;\
case MRB_TT_TRUE: (o).w = MRB_Qtrue; break;\
case MRB_TT_UNDEF: (o).w = MRB_Qundef; break;\
case MRB_TT_FIXNUM: (o).value.i_flag = MRB_FIXNUM_FLAG; (o).attr = (v); break;\
case MRB_TT_SYMBOL: (o).value.sym_flag = MRB_SYMBOL_FLAG; (o).attr = (v); break;\
case MRB_TT_FIXNUM: (o).w = 0;(o).value.i_flag = MRB_FIXNUM_FLAG; (o).attr = (v); break;\
case MRB_TT_SYMBOL: (o).w = 0;(o).value.sym_flag = MRB_SYMBOL_FLAG; (o).attr = (v); break;\
default: (o).w = 0; (o).attr = (v); if ((o).value.bp) (o).value.bp->tt = ttt; break;\
}\
} while (0)

0 comments on commit 51d7a69

Please sign in to comment.