Skip to content

Commit fb9aa71

Browse files
tebbiCommit Bot
authored andcommitted
Merged: [turbofan] fix bug in DeadCodeElimination
Revision: d4ddf64 BUG=chromium:1076708 NOTRY=true NOPRESUBMIT=true NOTREECHECKS=true TBR: [email protected] Change-Id: I8acdb4715a6786d954d5be49b909b136b4067969 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2187624 Reviewed-by: Tobias Tebbi <[email protected]> Commit-Queue: Tobias Tebbi <[email protected]> Cr-Commit-Position: refs/branch-heads/8.3@{v8#18} Cr-Branched-From: 1668abd-refs/heads/8.3.110@{#1} Cr-Branched-From: 04a7a68-refs/heads/master@{#66926}
1 parent 27289ec commit fb9aa71

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/compiler/dead-code-elimination.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,10 @@ Reduction DeadCodeElimination::ReduceDeoptimizeOrReturnOrTerminateOrTailCall(
317317
node->opcode() == IrOpcode::kTailCall);
318318
Reduction reduction = PropagateDeadControl(node);
319319
if (reduction.Changed()) return reduction;
320-
if (FindDeadInput(node) != nullptr) {
320+
// Terminate nodes are not part of actual control flow, so they should never
321+
// be replaced with Throw.
322+
if (node->opcode() != IrOpcode::kTerminate &&
323+
FindDeadInput(node) != nullptr) {
321324
Node* effect = NodeProperties::GetEffectInput(node, 0);
322325
Node* control = NodeProperties::GetControlInput(node, 0);
323326
if (effect->opcode() != IrOpcode::kUnreachable) {

0 commit comments

Comments
 (0)