summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-06-10 23:42:01 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-06-10 23:42:01 +0000
commitc7edd997e87d609feee894bf61b45f7f0a956eba (patch)
tree8c91f908870749c1bf6c53786745126142a58e06
parent85647d9f2b4b2da17827cc1d613f425748a39b3f (diff)
* vm.c: use VM_ASSERT instead of assert().
* vm_args.c: ditto. * vm_insnhelper.c: ditto. * vm_method.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50822 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog10
-rw-r--r--vm.c2
-rw-r--r--vm_args.c10
-rw-r--r--vm_insnhelper.c2
-rw-r--r--vm_method.c6
5 files changed, 20 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index dafe221..abe0bf7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+Thu Jun 11 08:27:06 2015 Koichi Sasada <ko1@atdot.net>
+
+ * 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@atdot.net>
* vm_core.h: define VM_ASSERT() for assertion
diff --git a/vm.c b/vm.c
index 80e3f05..fc135b0 100644
--- a/vm.c
+++ b/vm.c
@@ -2385,7 +2385,7 @@ core_hash_merge(VALUE hash, long argc, const VALUE *argv)
{
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]);
}
diff --git a/vm_args.c b/vm_args.c
index 32a3cfa..e466b10 100644
--- a/vm_args.c
+++ b/vm_args.c
@@ -49,7 +49,7 @@ args_extend(struct args_info *args, const int min_argc)
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 over_argc)
}
}
- 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 *args, VALUE *kw_hash_ptr, rb_thread_t *t
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 * const th, const rb_iseq_t * const iseq, r
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);
}
}
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index 926f342..76f5bbe 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -841,7 +841,7 @@ vm_throw_start(rb_thread_t * const th, rb_control_frame_t * const reg_cfp, int s
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);
}
}
diff --git a/vm_method.c b/vm_method.c
index 19ad5d3..e9d3ee2 100644
--- a/vm_method.c
+++ b/vm_method.c
@@ -135,7 +135,7 @@ rb_method_definition_release(rb_method_definition_t *def)
{
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_definition_t *def, void *opts)
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, VALUE klass, rb_method_visibility_t visi, r
METHOD_ENTRY_SAFE(me) = rb_safe_level();
rb_method_definition_reset(me, def);
- assert(def != NULL);
+ VM_ASSERT(def != NULL);
return me;
}