Commit f8a99dc8 authored by Igor Sheludko's avatar Igor Sheludko Committed by V8 LUCI CQ

[ext-code-space] Use Object::SafeEquals() in PrintMentionedObjectCache

... which works for stale pointers. The default == operator contains
a DCHECK guarding against Code vs. non-Code object comparisons and
thus it can't be used for stale pointer.

Bug: chromium:1360793, v8:11880
Change-Id: Ic5faf9b05e1586a15388cc1cbf3e8dcddbea452f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3879222
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Auto-Submit: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83028}
parent 32f48c47
......@@ -400,7 +400,8 @@ void StringStream::PrintMentionedObjectCache(Isolate* isolate) {
void StringStream::PrintSecurityTokenIfChanged(JSFunction fun) {
Object token = fun.native_context().security_token();
Isolate* isolate = fun.GetIsolate();
if (token != isolate->string_stream_current_security_token()) {
// Use SafeEquals because the cached token might be a stale pointer.
if (token.SafeEquals(isolate->string_stream_current_security_token())) {
Add("Security context: %o\n", token);
isolate->set_string_stream_current_security_token(token);
}
......
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