Revision
5271
Author
lsansonetti@apple.com
Date
2011-03-09 18:00:48 -0800 (Wed, 09 Mar 2011)

Log Message

make sure the redefined_ops gvars are always read-write, as it was causing a problem in the dead code elimination pass under AOT compilation

Modified Paths

Diff

Modified: MacRuby/trunk/vm.cpp (5270 => 5271)


--- MacRuby/trunk/vm.cpp	2011-03-10 02:00:13 UTC (rev 5270)
+++ MacRuby/trunk/vm.cpp	2011-03-10 02:00:48 UTC (rev 5271)
@@ -865,9 +865,11 @@
     GlobalVariable *gvar = NULL;
     if (iter == redefined_ops_gvars.end()) {
 	if (create) {
+	    // TODO: if OPTZ_LEVEL is 3, force global variables to always be
+	    // true and read-only.
 	    gvar = new GlobalVariable(*RoxorCompiler::module,
 		    Type::getInt8Ty(context),
-		    ruby_aot_compile ? true : false,
+		    false,
 		    GlobalValue::InternalLinkage,
 		    ConstantInt::get(Type::getInt8Ty(context), 0),
 		    "");