[macruby-changes] [2940] MacRuby/trunk/compiler.cpp

source_changes at macosforge.org source_changes at macosforge.org
Mon Nov 2 15:00:04 PST 2009


Revision: 2940
          http://trac.macosforge.org/projects/ruby/changeset/2940
Author:   lsansonetti at apple.com
Date:     2009-11-02 15:00:03 -0800 (Mon, 02 Nov 2009)
Log Message:
-----------
fixed a bug in the compilation of super without argument where the scoping method has arguments with default values

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

Modified: MacRuby/trunk/compiler.cpp
===================================================================
--- MacRuby/trunk/compiler.cpp	2009-11-02 22:12:19 UTC (rev 2939)
+++ MacRuby/trunk/compiler.cpp	2009-11-02 23:00:03 UTC (rev 2940)
@@ -4145,7 +4145,13 @@
 			if (i == rest_pos) {
 			    params.push_back(splatArgFollowsVal); 
 			}
-			params.push_back(iter);
+
+			// We can't simply push the direct argument address
+			// because if may have a default value.
+			ID argid = rb_intern(iter->getName().data());
+			Value *argslot = compile_lvar_slot(argid);
+			params.push_back(new LoadInst(argslot, "", bb));
+
 			++i;
 			++iter;
 		    }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20091102/f6f0df04/attachment.html>


More information about the macruby-changes mailing list