Skip to content

Commit

Permalink
* eval.c (method_missing): update old argument adjustment.
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@11290 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
matz committed Nov 7, 2006
1 parent 9372e9a commit 40a4d1c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
4 changes: 4 additions & 0 deletions ChangeLog
@@ -1,3 +1,7 @@
Tue Nov 7 17:18:11 2006 Yukihiro Matsumoto <matz@ruby-lang.org>

* eval.c (method_missing): update old argument adjustment.

Tue Nov 7 16:41:21 2006 Nobuyoshi Nakada <nobu@ruby-lang.org>

* eval.c (when_check): need to splat for NODE_ARGSCAT as well.
Expand Down
11 changes: 7 additions & 4 deletions eval.c
Expand Up @@ -5515,14 +5515,17 @@ method_missing(VALUE obj, ID id, int argc, const VALUE *argv,
}
if (argc < 0) {
VALUE tmp;
int n;

argc = -argc-1;
argc = -argc;
n = argc / 256 - 1;
argc %= 256;
tmp = svalue_to_avalue(argv[argc]);
nargv = ALLOCA_N(VALUE, argc + RARRAY_LEN(tmp) + 1);
nargv = ALLOCA_N(VALUE, argc + RARRAY_LEN(tmp) + n + 1);
MEMCPY(nargv+1, argv, VALUE, argc);
MEMCPY(nargv+1+argc, RARRAY_PTR(tmp), VALUE, RARRAY_LEN(tmp));
argc += RARRAY_LEN(tmp);

MEMCPY(nargv+1+argc+RARRAY_LEN(tmp), argv+argc+1, VALUE, n);
argc += RARRAY_LEN(tmp)+n;
}
else {
nargv = ALLOCA_N(VALUE, argc+1);
Expand Down

0 comments on commit 40a4d1c

Please sign in to comment.