Revision
2940
Author
lsansonetti@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

Diff

Modified: MacRuby/trunk/compiler.cpp (2939 => 2940)


--- 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;
 		    }