Commit 567aa1be authored by adamk's avatar adamk Committed by Commit bot

[full-codegen] Fix stack depth tracking when reporting unsupported super usages

Also mark VisitSuperCallReference as unreachable, as it's handled by VisitCall.

R=mstarzinger@chromium.org
BUG=v8:4967
LOG=n

Review-Url: https://codereview.chromium.org/1929213002
Cr-Commit-Position: refs/heads/master@{#35945}
parent b027b623
......@@ -678,11 +678,15 @@ void FullCodeGenerator::SetCallPosition(Expression* expr,
void FullCodeGenerator::VisitSuperPropertyReference(
SuperPropertyReference* super) {
__ CallRuntime(Runtime::kThrowUnsupportedSuperError);
// Even though this expression doesn't produce a value, we need to simulate
// plugging of the value context to ensure stack depth tracking is in sync.
if (context()->IsStackValue()) OperandStackDepthIncrement(1);
}
void FullCodeGenerator::VisitSuperCallReference(SuperCallReference* super) {
__ CallRuntime(Runtime::kThrowUnsupportedSuperError);
// Handled by VisitCall
UNREACHABLE();
}
......
// Copyright 2016 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.
assertThrows(() => {
new class extends Object {
constructor() { (() => delete super[super()])(); }
}
}, ReferenceError);
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