diff --git a/ChangeLog b/ChangeLog index 2ddf5b5e64..91f58e3c20 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Sun Aug 26 16:53:00 2012 Nobuyoshi Nakada + + * insns.def (checkmatch): suppress warnings. [ruby-core:47310] + [Bug #6930] + + * vm_core.h (VM_FRAME_TYPE_FINISH_P): ditto. + Fri Aug 24 15:42:28 2012 Nobuyoshi Nakada * lib/mkmf.rb (create_makefile): use timestamp for destination diff --git a/insns.def b/insns.def index d123ec2b33..797e5ec6f5 100644 --- a/insns.def +++ b/insns.def @@ -838,7 +838,9 @@ checkmatch if (flag & VM_CHECKMATCH_ARRAY) { int i; for (i = 0; i < RARRAY_LEN(pattern); i++) { - if (RTEST(check_match(RARRAY_PTR(pattern)[i], target, flag & VM_CHECKMATCH_TYPE_MASK))) { + enum vm_check_match_type checkmatch_type = + (enum vm_check_match_type)(flag & VM_CHECKMATCH_TYPE_MASK); + if (RTEST(check_match(RARRAY_PTR(pattern)[i], target, checkmatch_type))) { result = Qtrue; break; } diff --git a/vm_core.h b/vm_core.h index 14cf38e756..9d776c952d 100644 --- a/vm_core.h +++ b/vm_core.h @@ -645,7 +645,7 @@ enum vm_special_object_type { /* other frame flag */ #define VM_FRAME_FLAG_PASSED 0x0100 #define VM_FRAME_FLAG_FINISH 0x0200 -#define VM_FRAME_TYPE_FINISH_P(cfp) ((cfp)->flag & VM_FRAME_FLAG_FINISH) +#define VM_FRAME_TYPE_FINISH_P(cfp) (((cfp)->flag & VM_FRAME_FLAG_FINISH) != 0) #define RUBYVM_CFUNC_FRAME_P(cfp) \ (VM_FRAME_TYPE(cfp) == VM_FRAME_MAGIC_CFUNC) diff --git a/vm_insnhelper.c b/vm_insnhelper.c index 9850f07303..c1f797d779 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -1859,10 +1859,10 @@ check_match(VALUE pattern, VALUE target, enum vm_check_match_type type) case VM_CHECKMATCH_TYPE_CASE: return rb_funcall2(pattern, idEqq, 1, &target); case VM_CHECKMATCH_TYPE_RESCUE: { - if (!rb_obj_is_kind_of(pattern, rb_cModule)) { - rb_raise(rb_eTypeError, "class or module required for rescue clause"); - } - return RTEST(rb_funcall2(pattern, idEqq, 1, &target)); + if (!rb_obj_is_kind_of(pattern, rb_cModule)) { + rb_raise(rb_eTypeError, "class or module required for rescue clause"); + } + return RTEST(rb_funcall2(pattern, idEqq, 1, &target)); } default: rb_bug("check_match: unreachable");