Skip to content

Commit 7935d19

Browse files
isheludkoCommit Bot
authored andcommitted
[csa] Fix incorrect CAST in CSA::CheckEnumCache()
Bug: chromium:1022270 Change-Id: I6f1ee944b6cee977894d3cc425445f326a0866e5 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1924351 Reviewed-by: Toon Verwaest <verwaest@chromium.org> Commit-Queue: Igor Sheludko <ishell@chromium.org> Cr-Commit-Position: refs/heads/master@{#65042}
1 parent a7b9e58 commit 7935d19

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/codegen/code-stub-assembler.cc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13187,7 +13187,12 @@ TNode<Map> CodeStubAssembler::CheckEnumCache(TNode<HeapObject> receiver,
1318713187
{
1318813188
// Avoid runtime-call for empty dictionary receivers.
1318913189
GotoIfNot(IsDictionaryMap(receiver_map), if_runtime);
13190-
TNode<NameDictionary> properties = CAST(LoadSlowProperties(CAST(receiver)));
13190+
TNode<HashTableBase> properties =
13191+
UncheckedCast<HashTableBase>(LoadSlowProperties(CAST(receiver)));
13192+
CSA_ASSERT(this, Word32Or(IsNameDictionary(properties),
13193+
IsGlobalDictionary(properties)));
13194+
STATIC_ASSERT(static_cast<int>(NameDictionary::kNumberOfElementsIndex) ==
13195+
static_cast<int>(GlobalDictionary::kNumberOfElementsIndex));
1319113196
TNode<Smi> length = GetNumberOfElements(properties);
1319213197
GotoIfNot(TaggedEqual(length, SmiConstant(0)), if_runtime);
1319313198
// Check that there are no elements on the {receiver} and its prototype

0 commit comments

Comments
 (0)