Skip to content

Commit

Permalink
[csa] CSA type checks: allow the empty FixedArray to be CAST() to Fix…
Browse files Browse the repository at this point in the history
…edDoubleArray

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: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55015}
  • Loading branch information
tebbi authored and Commit Bot committed Aug 9, 2018
1 parent eb5cfbe commit 60d1277
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/compiler/code-assembler.cc
Expand Up @@ -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())) {
Expand Down

0 comments on commit 60d1277

Please sign in to comment.