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

source_changes at macosforge.org source_changes at macosforge.org
Tue Jun 22 13:29:08 PDT 2010


Revision: 4263
          http://trac.macosforge.org/projects/ruby/changeset/4263
Author:   lsansonetti at apple.com
Date:     2010-06-22 13:29:08 -0700 (Tue, 22 Jun 2010)
Log Message:
-----------
fixed the compilation of while loops with empty bodies (ex: '() while 1')

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

Modified: MacRuby/trunk/compiler.cpp
===================================================================
--- MacRuby/trunk/compiler.cpp	2010-06-22 19:36:08 UTC (rev 4262)
+++ MacRuby/trunk/compiler.cpp	2010-06-22 20:29:08 UTC (rev 4263)
@@ -4444,7 +4444,6 @@
 	case NODE_WHILE:
 	case NODE_UNTIL:
 	    {
-		assert(node->nd_body != NULL);
 		assert(node->nd_cond != NULL);
 
 		Function *f = bb->getParent();
@@ -4483,7 +4482,9 @@
 		current_loop_exit_val->addIncoming(nilVal, exitBB);
 
 		bb = bodyBB;
-		compile_node(node->nd_body);	
+		if (node->nd_body != NULL) {
+		    compile_node(node->nd_body);
+		}
 		bodyBB = bb;
 
 		BranchInst::Create(loopBB, bb);
@@ -4763,6 +4764,7 @@
     }
 
     // Compile selectors.
+
     Function *registerSelFunc = get_function("sel_registerName");
 
     for (std::map<SEL, GlobalVariable *>::iterator i = sels.begin();
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20100622/179d6b08/attachment.html>


More information about the macruby-changes mailing list