summaryrefslogtreecommitdiff
path: root/vm_insnhelper.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-06-03 19:12:26 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-06-03 19:12:26 +0000
commit4e870d302b94d90513534ea68416df36dbe3ce61 (patch)
treeff9b127e359c1e296e6660419b53edc6ea950029 /vm_insnhelper.c
parent4ab762de21ecf321cf88b8f17750f6f4ea9ebf3f (diff)
* vm_core.h (rb_vm_rewrite_cref_stack): rename to rb_vm_rewrite_cref().
* class.c (clone_method): use renamed name. * vm_insnhelper.c (rb_vm_rewrite_cref): do not use `node' in variable names. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50752 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r--vm_insnhelper.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index b5963ed840..3482f96b2e 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -465,23 +465,23 @@ rb_vm_get_cref(const VALUE *ep)
}
void
-rb_vm_rewrite_cref_stack(rb_cref_t *node, VALUE old_klass, VALUE new_klass, rb_cref_t **new_cref_ptr)
+rb_vm_rewrite_cref(rb_cref_t *cref, VALUE old_klass, VALUE new_klass, rb_cref_t **new_cref_ptr)
{
- rb_cref_t *new_node;
+ rb_cref_t *new_cref;
- while (node) {
- if (CREF_CLASS(node) == old_klass) {
- new_node = vm_cref_new(new_klass, 0, NULL);
- COPY_CREF_OMOD(new_node, node);
- CREF_NEXT_SET(new_node, CREF_NEXT(node));
- *new_cref_ptr = new_node;
+ while (cref) {
+ if (CREF_CLASS(cref) == old_klass) {
+ new_cref = vm_cref_new(new_klass, 0, NULL);
+ COPY_CREF_OMOD(new_cref, cref);
+ CREF_NEXT_SET(new_cref, CREF_NEXT(cref));
+ *new_cref_ptr = new_cref;
return;
}
- new_node = vm_cref_new(CREF_CLASS(node), 0, NULL);
- COPY_CREF_OMOD(new_node, node);
- node = CREF_NEXT(node);
- *new_cref_ptr = new_node;
- new_cref_ptr = (rb_cref_t **)&new_node->next;
+ new_cref = vm_cref_new(CREF_CLASS(cref), 0, NULL);
+ COPY_CREF_OMOD(new_cref, cref);
+ cref = CREF_NEXT(cref);
+ *new_cref_ptr = new_cref;
+ new_cref_ptr = (rb_cref_t **)&new_cref->next;
}
*new_cref_ptr = NULL;
}