diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-11-28 13:56:29 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-11-28 13:56:29 +0000 |
commit | ff2ca81bb387ceae24d70a139ec48f227a83be39 (patch) | |
tree | 2c09278367c9ba4e100f3ed002cc16b3259e1b9f /vm_insnhelper.c | |
parent | c6557c6fabfac078bda4ce19f1d1cda425998e48 (diff) | |
download | ruby-ff2ca81bb387ceae24d70a139ec48f227a83be39.tar.gz |
* vm_insnhelper.c (vm_call_method): fix undefined behavior.
Should not access scope local variable from outer scope.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37940 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r-- | vm_insnhelper.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c index 89cc0f2394..ab4fb38732 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -1698,6 +1698,7 @@ static inline VALUE vm_call_method(rb_thread_t *th, rb_control_frame_t *cfp, rb_call_info_t *ci) { int enable_fastpath = 1; + rb_call_info_t ci_temp; start_method_dispatch: if (ci->me != 0) { @@ -1735,8 +1736,8 @@ vm_call_method(rb_thread_t *th, rb_control_frame_t *cfp, rb_call_info_t *ci) } case VM_METHOD_TYPE_ZSUPER:{ VALUE klass = RCLASS_SUPER(ci->me->klass); - rb_call_info_t cie = *ci; - ci = &cie; + ci_temp = *ci; + ci = &ci_temp; ci->me = rb_method_entry(klass, ci->mid, &ci->defined_class); |