Commit fb8bda3a authored by Simon Zünd's avatar Simon Zünd Committed by V8 LUCI CQ

[inspector] Fix crash when building preview with a proxy prototype

This CL fixes a CHECK that checks the wrong thing. Specifically when
we `Advance` the debug::PropertyIterator it can throw an exception.
We have a CHECK that verifies that a corresponding v8::TryCatch catches
the exception when the return value indicates this. Unfortunately, the
CHECK was looking at the wrong v8::TryCatch scope.

R=jarin@chromium.org

Bug: chromium:1353051
Change-Id: Ic52e4efd44b89f8e4d1f6acace234c6065e081cb
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3829543
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82489}
parent 6a9c2bec
......@@ -1485,7 +1485,7 @@ bool ValueMirror::getProperties(v8::Local<v8::Context> context,
if (!accumulator->Add(std::move(mirror))) return true;
if (!iterator->Advance().FromMaybe(false)) {
CHECK(tryCatch.HasCaught());
CHECK(tryCatchAttributes.HasCaught());
return false;
}
}
......
Don't crash when building a preview with a revoked proxy prototype
{
className : Array
description : Array(0)
objectId : <objectId>
preview : {
description : Array(0)
overflow : false
properties : [
]
subtype : array
type : object
}
subtype : array
type : object
}
// Copyright 2022 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
const { Protocol } = InspectorTest.start('Don\'t crash when building a preview with a revoked proxy prototype');
(async () => {
const { result: { result } } = await Protocol.Runtime.evaluate({
expression: `
const {proxy, revoke} = Proxy.revocable({}, {});
revoke();
Object.setPrototypeOf([], proxy);`,
generatePreview: true,
});
InspectorTest.logMessage(result);
InspectorTest.completeTest();
})();
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