[macruby-changes] [5040] MacRuby/trunk

source_changes at macosforge.org source_changes at macosforge.org
Thu Dec 16 17:19:15 PST 2010


Revision: 5040
          http://trac.macosforge.org/projects/ruby/changeset/5040
Author:   lsansonetti at apple.com
Date:     2010-12-16 17:19:12 -0800 (Thu, 16 Dec 2010)
Log Message:
-----------
fix a bug when some splat methods defined with #define_method() would segfault at dispatch time

Modified Paths:
--------------
    MacRuby/trunk/compiler.cpp
    MacRuby/trunk/vm.cpp

Modified: MacRuby/trunk/compiler.cpp
===================================================================
--- MacRuby/trunk/compiler.cpp	2010-12-17 00:51:17 UTC (rev 5039)
+++ MacRuby/trunk/compiler.cpp	2010-12-17 01:19:12 UTC (rev 5040)
@@ -6635,7 +6635,7 @@
 
 	bb = BasicBlock::Create(context, "EntryBlock", f);
     }
-    else if (arity == -2) {
+    else if (arity < -1) {
 	// VALUE foo(VALUE rcv, SEL sel, VALUE argv)
 	// {
 	//	return rb_block_eval2(block, rcv, sel, RARRAY_LEN(argv),

Modified: MacRuby/trunk/vm.cpp
===================================================================
--- MacRuby/trunk/vm.cpp	2010-12-17 00:51:17 UTC (rev 5039)
+++ MacRuby/trunk/vm.cpp	2010-12-17 01:19:12 UTC (rev 5040)
@@ -2660,7 +2660,7 @@
 
     Function *func = RoxorCompiler::shared->compile_block_caller(block);
     IMP imp = GET_CORE()->compile(func);
-    NODE *body = rb_vm_cfunc_node_from_imp(klass, arity, imp, 0);
+    NODE *body = rb_vm_cfunc_node_from_imp(klass, arity < -1 ? -2 : arity, imp, 0);
     GC_RETAIN(body);
     GC_RETAIN(block);
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20101216/276de404/attachment.html>


More information about the macruby-changes mailing list