From 96b3ff0257e1ce642c0f7235a166aab523c80be7 Mon Sep 17 00:00:00 2001 From: Leszek Swirski Date: Tue, 19 Nov 2019 16:36:12 +0100 Subject: [PATCH] [parser] Fix unsafe object access in test-parsing Bug: v8:9996 Change-Id: I8c39a3a74a58e35eea784b8b26a2c519819b3269 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1924364 Commit-Queue: Leszek Swirski Commit-Queue: Igor Sheludko Auto-Submit: Leszek Swirski Reviewed-by: Igor Sheludko Cr-Commit-Position: refs/heads/master@{#65043} --- test/cctest/test-parsing.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/cctest/test-parsing.cc b/test/cctest/test-parsing.cc index 18f15af477..b0f77f45db 100644 --- a/test/cctest/test-parsing.cc +++ b/test/cctest/test-parsing.cc @@ -3308,7 +3308,7 @@ TEST(SerializationOfMaybeAssignmentFlag) { v8::Local v = CompileRun(src); i::Handle o = v8::Utils::OpenHandle(*v); i::Handle f = i::Handle::cast(o); - i::Context context = f->context(); + i::Handle context(f->context(), isolate); i::AstValueFactory avf(&zone, isolate->ast_string_constants(), HashSeed(isolate)); const i::AstRawString* name = avf.GetOneByteString("result"); @@ -3318,7 +3318,7 @@ TEST(SerializationOfMaybeAssignmentFlag) { i::DeclarationScope* script_scope = new (&zone) i::DeclarationScope(&zone, &avf); i::Scope* s = i::Scope::DeserializeScopeChain( - isolate, &zone, context.scope_info(), script_scope, &avf, + isolate, &zone, context->scope_info(), script_scope, &avf, i::Scope::DeserializationMode::kIncludingVariables); CHECK(s != script_scope); CHECK_NOT_NULL(name); @@ -3358,7 +3358,7 @@ TEST(IfArgumentsArrayAccessedThenParametersMaybeAssigned) { v8::Local v = CompileRun(src); i::Handle o = v8::Utils::OpenHandle(*v); i::Handle f = i::Handle::cast(o); - i::Context context = f->context(); + i::Handle context(f->context(), isolate); i::AstValueFactory avf(&zone, isolate->ast_string_constants(), HashSeed(isolate)); const i::AstRawString* name_x = avf.GetOneByteString("x"); @@ -3367,7 +3367,7 @@ TEST(IfArgumentsArrayAccessedThenParametersMaybeAssigned) { i::DeclarationScope* script_scope = new (&zone) i::DeclarationScope(&zone, &avf); i::Scope* s = i::Scope::DeserializeScopeChain( - isolate, &zone, context.scope_info(), script_scope, &avf, + isolate, &zone, context->scope_info(), script_scope, &avf, i::Scope::DeserializationMode::kIncludingVariables); CHECK(s != script_scope);