ruby-changes:38741
From: ko1 <ko1@a...>
Date: Thu, 11 Jun 2015 08:42:07 +0900 (JST)
Subject: [ruby-changes:38741] ko1:r50822 (trunk): * vm.c: use VM_ASSERT instead of assert().
ko1 2015-06-11 08:42:01 +0900 (Thu, 11 Jun 2015) New Revision: 50822 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=50822 Log: * vm.c: use VM_ASSERT instead of assert(). * vm_args.c: ditto. * vm_insnhelper.c: ditto. * vm_method.c: ditto. Modified files: trunk/ChangeLog trunk/vm.c trunk/vm_args.c trunk/vm_insnhelper.c trunk/vm_method.c Index: ChangeLog =================================================================== --- ChangeLog (revision 50821) +++ ChangeLog (revision 50822) @@ -1,3 +1,13 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Thu Jun 11 08:27:06 2015 Koichi Sasada <ko1@a...> + + * vm.c: use VM_ASSERT instead of assert(). + + * vm_args.c: ditto. + + * vm_insnhelper.c: ditto. + + * vm_method.c: ditto. + Thu Jun 11 08:16:48 2015 Koichi Sasada <ko1@a...> * vm_core.h: define VM_ASSERT() for assertion Index: vm_method.c =================================================================== --- vm_method.c (revision 50821) +++ vm_method.c (revision 50822) @@ -135,7 +135,7 @@ rb_method_definition_release(rb_method_d https://github.com/ruby/ruby/blob/trunk/vm_method.c#L135 { if (def != NULL) { const int count = def->alias_count; - if (METHOD_DEBUG) assert(count >= 0); + VM_ASSERT(count >= 0); if (count == 0) { if (METHOD_DEBUG) fprintf(stderr, "-%p-%s:%d\n", def, rb_id2name(def->original_id), count); @@ -258,7 +258,7 @@ rb_method_definition_set(rb_method_defin https://github.com/ruby/ruby/blob/trunk/vm_method.c#L258 DEF_OBJ_WRITE(&def->body.attr.location, rb_ary_freeze(location)); } else { - assert(def->body.attr.location == 0); + VM_ASSERT(def->body.attr.location == 0); } return; } @@ -340,7 +340,7 @@ rb_method_entry_create(ID called_id, VAL https://github.com/ruby/ruby/blob/trunk/vm_method.c#L340 METHOD_ENTRY_SAFE(me) = rb_safe_level(); rb_method_definition_reset(me, def); - assert(def != NULL); + VM_ASSERT(def != NULL); return me; } Index: vm.c =================================================================== --- vm.c (revision 50821) +++ vm.c (revision 50822) @@ -2385,7 +2385,7 @@ core_hash_merge(VALUE hash, long argc, c https://github.com/ruby/ruby/blob/trunk/vm.c#L2385 { long i; - assert(argc % 2 == 0); + VM_ASSERT(argc % 2 == 0); for (i=0; i<argc; i+=2) { rb_hash_aset(hash, argv[i], argv[i+1]); } Index: vm_insnhelper.c =================================================================== --- vm_insnhelper.c (revision 50821) +++ vm_insnhelper.c (revision 50822) @@ -841,7 +841,7 @@ vm_throw_start(rb_thread_t * const th, r https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L841 ep = VM_EP_PREV_EP(ep); base_iseq = base_iseq->parent_iseq; escape_cfp = rb_vm_search_cf_from_ep(th, escape_cfp, ep); - assert(escape_cfp->iseq == base_iseq); + VM_ASSERT(escape_cfp->iseq == base_iseq); } } Index: vm_args.c =================================================================== --- vm_args.c (revision 50821) +++ vm_args.c (revision 50822) @@ -49,7 +49,7 @@ args_extend(struct args_info *args, cons https://github.com/ruby/ruby/blob/trunk/vm_args.c#L49 if (args->rest) { args->rest = rb_ary_dup(args->rest); - assert(args->rest_index == 0); + VM_ASSERT(args->rest_index == 0); for (i=args->argc + RARRAY_LENINT(args->rest); i<min_argc; i++) { rb_ary_push(args->rest, Qnil); } @@ -78,7 +78,7 @@ args_reduce(struct args_info *args, int https://github.com/ruby/ruby/blob/trunk/vm_args.c#L78 } } - assert(args->argc >= over_argc); + VM_ASSERT(args->argc >= over_argc); args->argc -= over_argc; } @@ -194,7 +194,7 @@ args_pop_keyword_hash(struct args_info * https://github.com/ruby/ruby/blob/trunk/vm_args.c#L194 if (args->rest == Qfalse) { from_argv: - assert(args->argc > 0); + VM_ASSERT(args->argc > 0); *kw_hash_ptr = args->argv[args->argc-1]; if (keyword_hash_p(kw_hash_ptr, &rest_hash, th)) { @@ -652,11 +652,11 @@ setup_parameters_complex(rb_thread_t * c https://github.com/ruby/ruby/blob/trunk/vm_args.c#L652 arg.vals = arg.keys + kw_len; arg.argc = 0; rb_hash_foreach(keyword_hash, fill_keys_values, (VALUE)&arg); - assert(arg.argc == kw_len); + VM_ASSERT(arg.argc == kw_len); args_setup_kw_parameters(arg.vals, kw_len, arg.keys, iseq, klocals); } else { - assert(args_argc(args) == 0); + VM_ASSERT(args_argc(args) == 0); args_setup_kw_parameters(NULL, 0, NULL, iseq, klocals); } } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/