Index: runtime/vm/object_test.cc |
diff --git a/runtime/vm/object_test.cc b/runtime/vm/object_test.cc |
index c435602c24a15d7c8f053d718f1c4ef163dd04eb..fb4b621d61096674bfa36cd4d717a7a71813f2a5 100644 |
--- a/runtime/vm/object_test.cc |
+++ b/runtime/vm/object_test.cc |
@@ -10,6 +10,7 @@ |
#include "vm/dart_entry.h" |
#include "vm/debugger.h" |
#include "vm/isolate.h" |
+#include "vm/malloc_hooks.h" |
#include "vm/object.h" |
#include "vm/object_store.h" |
#include "vm/simulator.h" |
@@ -2709,6 +2710,9 @@ ISOLATE_UNIT_TEST_CASE(Code) { |
// Test for immutability of generated instructions. The test crashes with a |
// segmentation fault when writing into it. |
ISOLATE_UNIT_TEST_CASE(CodeImmutability) { |
+ bool stack_trace_collection_enabled = |
+ MallocHooks::stack_trace_collection_enabled(); |
+ MallocHooks::set_stack_trace_collection_enabled(false); |
extern void GenerateIncrement(Assembler * assembler); |
Assembler _assembler_; |
GenerateIncrement(&_assembler_); |
@@ -2726,6 +2730,8 @@ ISOLATE_UNIT_TEST_CASE(CodeImmutability) { |
// TODO(regis, fschneider): Should this be FATAL() instead? |
OS::DebugBreak(); |
} |
+ MallocHooks::set_stack_trace_collection_enabled( |
+ stack_trace_collection_enabled); |
} |