summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-02 15:23:49 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-02 15:23:49 +0000
commit8dbd427ae9f0c84746421032b5f4eb9750f5b895 (patch)
treedb4c70dd95fffb574d2f33b3866a13986b96842c
parentb64bcf55a7d1c7f08ba4c8d1853e89c0761aa820 (diff)
downloadruby-8dbd427ae9f0c84746421032b5f4eb9750f5b895.tar.gz
ruby-8dbd427ae9f0c84746421032b5f4eb9750f5b895.tar.xz
ruby-8dbd427ae9f0c84746421032b5f4eb9750f5b895.zip
* vm_insnhelper.c (vm_method_missing): copy arguments to allocated
memory from machine stack. [ruby-dev:36064] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19072 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--vm_insnhelper.c5
2 files changed, 8 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 8eeb8ffbf..a77d23b32 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Wed Sep 3 00:23:25 2008 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * vm_insnhelper.c (vm_method_missing): copy arguments to allocated
+ memory from machine stack. [ruby-dev:36064]
+
Tue Sep 2 22:20:26 2008 Tanaka Akira <akr@fsij.org>
* transcode_data.h (base_element): removed.
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index abf74d749..cfac3a4dc 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -410,13 +410,14 @@ vm_method_missing(rb_thread_t *th, ID id, VALUE recv,
int num, rb_block_t *blockptr, int opt)
{
rb_control_frame_t * const reg_cfp = th->cfp;
- VALUE *argv = STACK_ADDR_FROM_TOP(num + 1);
+ VALUE *argv = ALLOCA_N(VALUE, num + 1);
+ MEMCPY(argv, STACK_ADDR_FROM_TOP(num + 1), VALUE, num + 1);
VALUE val;
argv[0] = ID2SYM(id);
th->method_missing_reason = opt;
th->passed_block = blockptr;
- val = rb_funcall2(recv, idMethodMissing, num + 1, argv);
POPN(num + 1);
+ val = rb_funcall2(recv, idMethodMissing, num + 1, argv);
return val;
}