[CSA] Fix the typed verison of Select to strictly check types.
Previously, typing errors would be hidden by the SloppyTNode cast. Both lambdas should always return strictly checked types that match the templated type of the select, otherwise unchecked values can reach TNodes. Bug: v8:7479 Change-Id: Icd316c21a30c8c8305b7740c985efaa54c9a7015 Reviewed-on: https://chromium-review.googlesource.com/934455 Reviewed-by: Tobias Tebbi <tebbi@chromium.org> Commit-Queue: Peter Marshall <petermarshall@chromium.org> Cr-Commit-Position: refs/heads/master@{#51515}
This commit is contained in:
parent
53e00e3900
commit
5621814e0b
@ -356,15 +356,11 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler {
|
||||
template <class A, class F, class G>
|
||||
TNode<A> Select(SloppyTNode<BoolT> condition, const F& true_body,
|
||||
const G& false_body, MachineRepresentation rep) {
|
||||
return UncheckedCast<A>(
|
||||
Select(condition,
|
||||
[&]() -> Node* {
|
||||
return base::implicit_cast<SloppyTNode<A>>(true_body());
|
||||
},
|
||||
[&]() -> Node* {
|
||||
return base::implicit_cast<SloppyTNode<A>>(false_body());
|
||||
},
|
||||
rep));
|
||||
return UncheckedCast<A>(Select(
|
||||
condition,
|
||||
[&]() -> Node* { return base::implicit_cast<TNode<A>>(true_body()); },
|
||||
[&]() -> Node* { return base::implicit_cast<TNode<A>>(false_body()); },
|
||||
rep));
|
||||
}
|
||||
|
||||
Node* SelectConstant(Node* condition, Node* true_value, Node* false_value,
|
||||
|
Loading…
Reference in New Issue
Block a user