Skip to content

Commit

Permalink
make sure the redefined_ops gvars are always read-write, as it was ca…
Browse files Browse the repository at this point in the history
…using a problem in the dead code elimination pass under AOT compilation

git-svn-id: http://svn.macosforge.org/repository/ruby/MacRuby/trunk@5271 23306eb0-4c56-4727-a40e-e92c0eb68959
  • Loading branch information
lrz committed Mar 10, 2011
1 parent da50a49 commit d992548
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion vm.cpp
Expand Up @@ -865,9 +865,11 @@ RoxorCore::redefined_op_gvar(SEL sel, bool create)
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),
"");
Expand Down

0 comments on commit d992548

Please sign in to comment.