Index: runtime/vm/isolate.cc |
diff --git a/runtime/vm/isolate.cc b/runtime/vm/isolate.cc |
index 8d5ee80509795bad53c7f35de0dc52f6e6ed2008..a58c7baaf5373bda3593acfe5e392e14a42cb287 100644 |
--- a/runtime/vm/isolate.cc |
+++ b/runtime/vm/isolate.cc |
@@ -148,14 +148,15 @@ NoReloadScope::NoReloadScope(Isolate* isolate, Thread* thread) |
isolate_(isolate) { |
ASSERT(isolate_ != NULL); |
AtomicOperations::FetchAndIncrement(&(isolate_->no_reload_scope_depth_)); |
+ ASSERT( |
+ AtomicOperations::LoadRelaxed(&(isolate_->no_reload_scope_depth_)) >= 0); |
} |
NoReloadScope::~NoReloadScope() { |
- uintptr_t previous_value = |
- AtomicOperations::FetchAndDecrement(&(isolate_->no_reload_scope_depth_)); |
- // If the previous value was 0 we have underflowed. |
- ASSERT(previous_value != 0); |
+ AtomicOperations::FetchAndDecrement(&(isolate_->no_reload_scope_depth_)); |
+ ASSERT( |
+ AtomicOperations::LoadRelaxed(&(isolate_->no_reload_scope_depth_)) >= 0); |
} |