Skip to content

Commit 11bc046

Browse files
committed
[MERGE chakra-core#4965 @sethbrenith] Check that PropertyValueInfo refers to correct PolymorphicInlineCache when resizing
Merge pull request chakra-core#4965 from sethbrenith:user/sethb/check-polymorphic-cache A previous bug (which is already fixed) could lead to a case where we attempted to resize the wrong PolymorphicInlineCache instance. These new assertions make our assumptions more clear, and would have caught the problem upon first resize rather than only after the cache size passed its maximum. Fixes OS:16712443
2 parents 270b9e9 + 2e0d892 commit 11bc046

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

lib/Runtime/Language/CacheOperators.inl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,7 @@ namespace Js
447447
{
448448
if (info->GetFunctionBody())
449449
{
450+
Assert(polymorphicInlineCache == info->GetFunctionBody()->GetPolymorphicInlineCache(info->GetInlineCacheIndex()));
450451
polymorphicInlineCache =
451452
info->GetFunctionBody()->CreateBiggerPolymorphicInlineCache(
452453
info->GetInlineCacheIndex(),
@@ -455,6 +456,7 @@ namespace Js
455456
else
456457
{
457458
Assert(!info->GetFunctionBody());
459+
Assert(polymorphicInlineCache == (IsRead ? info->GetPropertyRecordUsageCache()->GetLdElemInlineCache() : info->GetPropertyRecordUsageCache()->GetStElemInlineCache()));
458460
polymorphicInlineCache = info->GetPropertyRecordUsageCache()->CreateBiggerPolymorphicInlineCache(IsRead);
459461
}
460462
}

0 commit comments

Comments
 (0)