Fix memory leak of verifier small precise constants.
Change-Id: Icaabb2061916daeaba66f1f012b6e79f7f3318e6
diff --git a/runtime/verifier/reg_type_cache.cc b/runtime/verifier/reg_type_cache.cc
index a62e835..9c9673a 100644
--- a/runtime/verifier/reg_type_cache.cc
+++ b/runtime/verifier/reg_type_cache.cc
@@ -262,11 +262,11 @@
FloatType::Destroy();
DoubleLoType::Destroy();
DoubleHiType::Destroy();
- for (uint16_t value = kMinSmallConstant; value <= kMaxSmallConstant; ++value) {
+ for (int32_t value = kMinSmallConstant; value <= kMaxSmallConstant; ++value) {
PreciseConstType* type = small_precise_constants_[value - kMinSmallConstant];
delete type;
+ small_precise_constants_[value - kMinSmallConstant] = nullptr;
}
-
RegTypeCache::primitive_initialized_ = false;
RegTypeCache::primitive_count_ = 0;
}