Skip to content

Instantly share code, notes, and snippets.

@shugo
Created March 1, 2010 09:33
Show Gist options
  • Save shugo/318231 to your computer and use it in GitHub Desktop.
Save shugo/318231 to your computer and use it in GitHub Desktop.
diff --git a/iseq.c b/iseq.c
index 80364ca..fc13d70 100644
--- a/iseq.c
+++ b/iseq.c
@@ -1344,11 +1344,15 @@ rb_iseq_clone(VALUE iseqval, VALUE newcbase)
if (!iseq1->orig) {
iseq1->orig = iseqval;
}
+ if (iseq0->local_iseq == iseq0) {
+ iseq1->local_iseq = iseq1;
+ }
if (newcbase) {
iseq1->cref_stack = NEW_BLOCK(newcbase);
if (iseq0->cref_stack->nd_next) {
iseq1->cref_stack->nd_next = iseq0->cref_stack->nd_next;
}
+ iseq1->klass = newcbase;
}
return newiseq;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment