Commit 60d1277f authored by Tobias Tebbi's avatar Tobias Tebbi Committed by Commit Bot

[csa] CSA type checks: allow the empty FixedArray to be CAST() to FixedDoubleArray

This should allow to re-land https://crrev.com/c/1039190

Bug: chromium:871886

Change-Id: If815537410b3fa09902026dc26205421f5c36ae5
Reviewed-on: https://chromium-review.googlesource.com/1169019
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55015}
parent eb5cfbe0
......@@ -1709,6 +1709,11 @@ void CodeAssemblerLabel::UpdateVariablesAfterBind() {
} // namespace compiler
Smi* CheckObjectType(Object* value, Smi* type, String* location) {
// Allow the empty FixedArray to be treated as a FixedDoubleArray.
if (static_cast<ObjectType>(type->value()) == ObjectType::kFixedDoubleArray &&
value->IsFixedArray() && FixedArray::cast(value)->length() == 0) {
return Smi::FromInt(0);
}
#ifdef DEBUG
const char* expected;
switch (static_cast<ObjectType>(type->value())) {
......
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