Skip to content

Commit 0caaa4e

Browse files
victorgomesV8 LUCI CQ
authored andcommitted
[maglev] GeneratorRestoreRegister can be the hole
Fixed: 464965404 Change-Id: Iace45b1484358e2e9040ba454fb2aad2f6e6d49c Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7210779 Reviewed-by: Marja Hölttä <[email protected]> Commit-Queue: Victor Gomes <[email protected]> Auto-Submit: Victor Gomes <[email protected]> Cr-Commit-Position: refs/heads/main@{#104031}
1 parent 1eb1215 commit 0caaa4e

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

src/maglev/maglev-ir.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -715,6 +715,7 @@ constexpr bool CanBeTheHoleValue(Opcode opcode) {
715715
// TODO(victorgomes): Should we have a list of builtins that could
716716
// return the hole?
717717
case Opcode::kCallBuiltin:
718+
case Opcode::kGeneratorRestoreRegister:
718719
case Opcode::kRootConstant:
719720
case Opcode::kLoadContextSlot:
720721
case Opcode::kLoadContextSlotNoCells:
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Copyright 2025 the V8 project authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
// Flags: --allow-natives-syntax
6+
7+
function* foo(flag) {
8+
if (flag) yield val;
9+
let val = 1;
10+
}
11+
12+
for (let i = 0; i < 500; ++i) {
13+
for (let a of foo()) {}
14+
}
15+
16+
function bar() {
17+
for (let b of foo(true)) {
18+
if (b) { assertUnreachable(); }
19+
}
20+
}
21+
22+
assertThrows(() => bar());

0 commit comments

Comments
 (0)