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

source_changes at macosforge.org source_changes at macosforge.org
Thu Jul 8 16:39:15 PDT 2010


Revision: 4333
          http://trac.macosforge.org/projects/ruby/changeset/4333
Author:   lsansonetti at apple.com
Date:     2010-07-08 16:39:15 -0700 (Thu, 08 Jul 2010)
Log Message:
-----------
support for splat when clauses inside empty-case statements (don't ask me why)

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

Modified: MacRuby/trunk/compiler.cpp
===================================================================
--- MacRuby/trunk/compiler.cpp	2010-07-08 22:56:52 UTC (rev 4332)
+++ MacRuby/trunk/compiler.cpp	2010-07-08 23:39:15 UTC (rev 4333)
@@ -529,6 +529,9 @@
 Value *
 RoxorCompiler::compile_when_splat(Value *comparedToVal, Value *splatVal)
 {
+    if (comparedToVal == NULL) {
+	return splatVal;
+    }
     GlobalVariable *is_redefined = GET_CORE()->redefined_op_gvar(selEqq, true);
     Value *args[] = {
 	new LoadInst(is_redefined, "", bb),
@@ -4525,7 +4528,7 @@
 
 		assert(subnode != NULL);
 		assert(nd_type(subnode) == NODE_WHEN);
-		while ((subnode != NULL) && (nd_type(subnode) == NODE_WHEN)) {
+		while (subnode != NULL && nd_type(subnode) == NODE_WHEN) {
 		    NODE *valueNode = subnode->nd_head;
 		    assert(valueNode != NULL);
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20100708/0a8edc42/attachment-0001.html>


More information about the macruby-changes mailing list