[macruby-changes] [3172] MacRuby/branches/ticket159/compiler.cpp

source_changes at macosforge.org source_changes at macosforge.org
Thu Dec 24 15:18:46 PST 2009


Revision: 3172
          http://trac.macosforge.org/projects/ruby/changeset/3172
Author:   emoy at apple.com
Date:     2009-12-24 15:18:43 -0800 (Thu, 24 Dec 2009)
Log Message:
-----------
Branch ticket159: fix compiler warning and minor clean up

Modified Paths:
--------------
    MacRuby/branches/ticket159/compiler.cpp

Modified: MacRuby/branches/ticket159/compiler.cpp
===================================================================
--- MacRuby/branches/ticket159/compiler.cpp	2009-12-24 04:39:30 UTC (rev 3171)
+++ MacRuby/branches/ticket159/compiler.cpp	2009-12-24 23:18:43 UTC (rev 3172)
@@ -2470,13 +2470,6 @@
 	    }
 	}
 
-	if (newFloatFunc == NULL) {
-	    // VALUE rb_float_new_retained(double)
-	    newFloatFunc = cast<Function>
-		(module->getOrInsertFunction("rb_float_new_retained",
-					     RubyObjTy, DoubleTy, NULL));
-	}
-
 	rb_vm_immediate_val_t leftImm, rightImm;
 	const bool leftIsImmediateConst = unbox_immediate_val(leftRVal,
 		&leftImm);
@@ -2586,8 +2579,8 @@
 	    BranchInst::Create(not_redefined_bb, dispatch_bb, isOpRedefined,
 		    bb);
 
-	    BasicBlock *div_by_zero_bb;
-	    BasicBlock *optimize_fixnum_cont_bb;
+	    BasicBlock *div_by_zero_bb = NULL;
+	    BasicBlock *optimize_fixnum_cont_bb = NULL;
 	    BasicBlock *optimize_fixnum_ret_bb;
 	    /*
 	     * In the case of integer division, we need to test for the
@@ -2763,6 +2756,13 @@
 
 	    if (!result_is_predicate) {
 		// Box the float. 
+		if (newFloatFunc == NULL) {
+		    // VALUE rb_float_new_retained(double)
+		    newFloatFunc = cast<Function>
+			(module->getOrInsertFunction("rb_float_new_retained",
+						     RubyObjTy, DoubleTy,
+						     NULL));
+		}
 		std::vector<Value *> params;
 		params.push_back(flp_op_res);
 		flp_op_res = CallInst::Create(newFloatFunc, params.begin(),
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20091224/ccfb5d98/attachment.html>


More information about the macruby-changes mailing list