Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Conditionally check on the class and don't overwrite it

  • Loading branch information...
commit 9808549af7afca768ca4d5e0dcd41d8563e2d6a0 1 parent c166dbd
@dbussink dbussink authored
Showing with 8 additions and 7 deletions.
  1. +8 −7 vm/llvm/inline_primitive.cpp
View
15 vm/llvm/inline_primitive.cpp
@@ -1309,14 +1309,15 @@ namespace rubinius {
type::KnownType kt = type::KnownType::extract(ops.context(), cls);
if(kt.constant_cache_p()) {
ConstantCache* constant_cache = kt.constant_cache();
- klass = try_as<Class>(constant_cache->value());
- type::KnownType kt = type::KnownType::unknown();
- if(kind_of<SingletonClass>(klass)) {
- kt = type::KnownType::singleton_instance(klass->class_id());
- } else {
- kt = type::KnownType::instance(klass->class_id());
+ if(Class* cache_klass = try_as<Class>(constant_cache->value())) {
+ type::KnownType kt = type::KnownType::unknown();
+ if(kind_of<SingletonClass>(cache_klass)) {
+ kt = type::KnownType::singleton_instance(cache_klass->class_id());
+ } else {
+ kt = type::KnownType::instance(cache_klass->class_id());
+ }
+ kt.associate(ops.context(), out);
}
- kt.associate(ops.context(), out);
}
i.set_result(out);
Please sign in to comment.
Something went wrong with that request. Please try again.