Commit 230b339f authored by David Carlier's avatar David Carlier Committed by Commit Bot

Add a null check for the slot argument of the TraceReference constructor

This check is useful for preventing a segfault upon usage of this argument.

Change-Id: I3cc77f84d7e3ca2a96ec36a50bddb9c2eadeb62f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1946336Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65373}
parent ea160554
...@@ -1034,6 +1034,10 @@ i::Address* V8::GlobalizeTracedReference(i::Isolate* isolate, i::Address* obj, ...@@ -1034,6 +1034,10 @@ i::Address* V8::GlobalizeTracedReference(i::Isolate* isolate, i::Address* obj,
internal::Address* slot, internal::Address* slot,
bool has_destructor) { bool has_destructor) {
LOG_API(isolate, TracedGlobal, New); LOG_API(isolate, TracedGlobal, New);
#ifdef DEBUG
Utils::ApiCheck((slot != nullptr), "v8::GlobalizeTracedReference",
"the address slot must be not null");
#endif
i::Handle<i::Object> result = i::Handle<i::Object> result =
isolate->global_handles()->CreateTraced(*obj, slot, has_destructor); isolate->global_handles()->CreateTraced(*obj, slot, has_destructor);
#ifdef VERIFY_HEAP #ifdef VERIFY_HEAP
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment