Commit dee91da8 authored by mstarzinger's avatar mstarzinger Committed by Commit bot

[turbofan] Fix undefined behavior in Int64Lowering.

This fixes undefined behavior introduced by extracting the const call
descriptor of a call node as non-const. Such an implicit cast between
constness is not safe and should be avoided.

R=ahaas@chromium.org
TEST=unittests/Int64LoweringTest.CallI64Parameter
BUG=v8:4924
LOG=n

Review URL: https://codereview.chromium.org/1900563002

Cr-Commit-Position: refs/heads/master@{#35569}
parent 559113b0
......@@ -223,7 +223,9 @@ void Int64Lowering::LowerNode(Node* node) {
break;
}
case IrOpcode::kCall: {
CallDescriptor* descriptor = OpParameter<CallDescriptor*>(node);
// TODO(turbofan): Make WASM code const-correct wrt. CallDescriptor.
CallDescriptor* descriptor =
const_cast<CallDescriptor*>(OpParameter<const CallDescriptor*>(node));
if (DefaultLowering(node) ||
(descriptor->ReturnCount() == 1 &&
descriptor->GetReturnType(0) == MachineType::Int64())) {
......
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