diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | insns.def | 4 | ||||
-rw-r--r-- | vm_core.h | 2 | ||||
-rw-r--r-- | vm_insnhelper.c | 8 |
4 files changed, 15 insertions, 6 deletions
@@ -1,3 +1,10 @@ +Sun Aug 26 16:53:00 2012 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * 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 <nobu@ruby-lang.org> * lib/mkmf.rb (create_makefile): use timestamp for destination @@ -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; } @@ -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"); |