Index: src/api.cc |
diff --git a/src/api.cc b/src/api.cc |
index c405b875385e4e1ad8235d6148b97f66f2bd7ac2..dc04a950ea36b8543f43dc2449906ce704e3ace1 100644 |
--- a/src/api.cc |
+++ b/src/api.cc |
@@ -6531,7 +6531,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(); |
} |
@@ -6738,7 +6739,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(); |
} |