Index: src/x64/assembler-x64.cc |
diff --git a/src/x64/assembler-x64.cc b/src/x64/assembler-x64.cc |
index b13fbe852514890c10bd16d59c8e89af297e40ab..4f61b9bd2dbfca9efd686b6e36b32f062962d04c 100644 |
--- a/src/x64/assembler-x64.cc |
+++ b/src/x64/assembler-x64.cc |
@@ -354,7 +354,7 @@ Assembler::Assembler(Isolate* arg_isolate, void* buffer, int buffer_size) |
if (buffer_size <= kMinimalBufferSize) { |
buffer_size = kMinimalBufferSize; |
- if (isolate()->assembler_spare_buffer() != NULL) { |
+ if (isolate() != NULL && isolate()->assembler_spare_buffer() != NULL) { |
buffer = isolate()->assembler_spare_buffer(); |
isolate()->set_assembler_spare_buffer(NULL); |
} |
@@ -398,7 +398,8 @@ Assembler::Assembler(Isolate* arg_isolate, void* buffer, int buffer_size) |
Assembler::~Assembler() { |
if (own_buffer_) { |
- if (isolate()->assembler_spare_buffer() == NULL && |
+ if (isolate() != NULL && |
+ isolate()->assembler_spare_buffer() == NULL && |
buffer_size_ == kMinimalBufferSize) { |
isolate()->set_assembler_spare_buffer(buffer_); |
} else { |
@@ -521,7 +522,8 @@ void Assembler::GrowBuffer() { |
reloc_info_writer.pos(), desc.reloc_size); |
// Switch buffers. |
- if (isolate()->assembler_spare_buffer() == NULL && |
+ if (isolate() != NULL && |
+ isolate()->assembler_spare_buffer() == NULL && |
buffer_size_ == kMinimalBufferSize) { |
isolate()->set_assembler_spare_buffer(buffer_); |
} else { |