Skip to content

Commit c42a07f

Browse files
LiedtkeV8 LUCI CQ
authored andcommitted
[compiler][wasm] Fix TypeGuard on br_on_cast with null type
Similar pattern to https://crrev.com/c/5826664 . Fixed: 361862737 Change-Id: I59c3cea5d572423aa06583a1448bf7486213a233 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5829361 Reviewed-by: Jakob Kummerow <[email protected]> Auto-Submit: Matthias Liedtke <[email protected]> Commit-Queue: Matthias Liedtke <[email protected]> Commit-Queue: Jakob Kummerow <[email protected]> Cr-Commit-Position: refs/heads/main@{#95899}
1 parent 1ab5888 commit c42a07f

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/wasm/graph-builder-interface.cc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1858,8 +1858,13 @@ class WasmGraphBuildingInterface {
18581858
// and BrOnNull interacts with the values on the stack.
18591859
// TODO(14034): The compiler shouldn't have to access the stack used by
18601860
// the decoder ideally.
1861+
// Note: This TypeGuard doesn't add any new type information but we need
1862+
// a non-const Value that we can return to the decoder for
1863+
// value_on_branch. The clean solution would be to emit the TypeGuard
1864+
// with the branch-type in the effect edge of the branch and use
1865+
// value_on_branch->type as type there.
18611866
SetAndTypeNode(value_on_branch,
1862-
builder_->TypeGuard(object.node, value_on_branch->type));
1867+
builder_->TypeGuard(object.node, object.type));
18631868
return BrOnNull(decoder, object, br_depth, true, value_on_branch);
18641869
case HeapType::kAny:
18651870
// Any may never need a cast as it is either implicitly convertible or

0 commit comments

Comments
 (0)