Index: src/api.cc |
diff --git a/src/api.cc b/src/api.cc |
index 10a83fadbe58ecbe571ff03c269e84bf0b1a8338..664b80e38a7d4f7f11f37681a7b362eec2aa3d74 100644 |
--- a/src/api.cc |
+++ b/src/api.cc |
@@ -6560,7 +6560,8 @@ v8::ArrayBuffer::Contents v8::ArrayBuffer::Externalize() { |
Utils::ApiCheck(!self->is_external(), "v8::ArrayBuffer::Externalize", |
"ArrayBuffer already externalized"); |
self->set_is_external(true); |
- isolate->heap()->UnregisterArrayBuffer(self->backing_store()); |
+ isolate->heap()->UnregisterArrayBuffer(isolate->heap()->InNewSpace(*self), |
+ self->backing_store()); |
return GetContents(); |
} |
@@ -6767,7 +6768,8 @@ v8::SharedArrayBuffer::Contents v8::SharedArrayBuffer::Externalize() { |
Utils::ApiCheck(!self->is_external(), "v8::SharedArrayBuffer::Externalize", |
"SharedArrayBuffer already externalized"); |
self->set_is_external(true); |
- isolate->heap()->UnregisterArrayBuffer(self->backing_store()); |
+ isolate->heap()->UnregisterArrayBuffer(isolate->heap()->InNewSpace(*self), |
+ self->backing_store()); |
return GetContents(); |
} |