Index: src/heap.cc |
=================================================================== |
--- src/heap.cc (revision 1641) |
+++ src/heap.cc (working copy) |
@@ -2864,22 +2864,26 @@ |
#ifdef ENABLE_HEAP_PROTECTION |
void Heap::Protect() { |
- new_space_.Protect(); |
- map_space_->Protect(); |
- old_pointer_space_->Protect(); |
- old_data_space_->Protect(); |
- code_space_->Protect(); |
- lo_space_->Protect(); |
+ if (HasBeenSetup()) { |
+ new_space_.Protect(); |
+ map_space_->Protect(); |
+ old_pointer_space_->Protect(); |
+ old_data_space_->Protect(); |
+ code_space_->Protect(); |
+ lo_space_->Protect(); |
+ } |
} |
void Heap::Unprotect() { |
- new_space_.Unprotect(); |
- map_space_->Unprotect(); |
- old_pointer_space_->Unprotect(); |
- old_data_space_->Unprotect(); |
- code_space_->Unprotect(); |
- lo_space_->Unprotect(); |
+ if (HasBeenSetup()) { |
+ new_space_.Unprotect(); |
+ map_space_->Unprotect(); |
+ old_pointer_space_->Unprotect(); |
+ old_data_space_->Unprotect(); |
+ code_space_->Unprotect(); |
+ lo_space_->Unprotect(); |
+ } |
} |
#endif |