[前][次][番号順一覧][スレッド一覧]

ruby-changes:40323

From: nobu <ko1@a...>
Date: Sat, 31 Oct 2015 13:55:04 +0900 (JST)
Subject: [ruby-changes:40323] nobu:r52404 (trunk): vm_insnhelper.c: get rid of copying garbage

nobu	2015-10-31 13:54:45 +0900 (Sat, 31 Oct 2015)

  New Revision: 52404

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=52404

  Log:
    vm_insnhelper.c: get rid of copying garbage
    
    * vm_insnhelper.c (vm_call_method_missing): get rid of extra
      garbage after argv.

  Modified files:
    trunk/vm_insnhelper.c
Index: vm_insnhelper.c
===================================================================
--- vm_insnhelper.c	(revision 52403)
+++ vm_insnhelper.c	(revision 52404)
@@ -1919,8 +1919,8 @@ vm_call_method_missing(rb_thread_t *th, https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L1919
 
     /* shift arguments: m(a, b, c) #=> method_missing(:m, a, b, c) */
     CHECK_VM_STACK_OVERFLOW(reg_cfp, 1);
-    if (argc > 0) {
-	MEMMOVE(argv+1, argv, VALUE, argc);
+    if (argc > 1) {
+	MEMMOVE(argv+1, argv, VALUE, argc-1);
     }
     argv[0] = ID2SYM(orig_ci->mid);
     INC_SP(1);

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]