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

source_changes at macosforge.org source_changes at macosforge.org
Sat Aug 15 18:36:57 PDT 2009


Revision: 2327
          http://trac.macosforge.org/projects/ruby/changeset/2327
Author:   vincent.isambart at gmail.com
Date:     2009-08-15 18:36:56 -0700 (Sat, 15 Aug 2009)
Log Message:
-----------
fixed ensure with an empty block

begin
  return
ensure
  p :ok
end

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

Modified: MacRuby/trunk/compiler.cpp
===================================================================
--- MacRuby/trunk/compiler.cpp	2009-08-15 04:24:47 UTC (rev 2326)
+++ MacRuby/trunk/compiler.cpp	2009-08-16 01:36:56 UTC (rev 2327)
@@ -4495,8 +4495,11 @@
 
 	case NODE_ENSURE:
 	    {
-		assert(node->nd_head != NULL);
 		assert(node->nd_ensr != NULL);
+		if (node->nd_head == NULL) {
+		    compile_node(node->nd_ensr);
+		    return nilVal;
+		}
 
 		Function *f = bb->getParent();
 		BasicBlock *old_ensure_bb = ensure_bb;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090815/5192df24/attachment.html>


More information about the macruby-changes mailing list