Skip to content

Commit 31f2588

Browse files
committed
1 parent b75847e commit 31f2588

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/Runtime/Library/BoundFunction.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,12 @@ namespace Js
354354
Var varLength;
355355
if (targetFunction->GetProperty(targetFunction, PropertyIds::length, &varLength, nullptr, requestContext))
356356
{
357+
if (!TaggedInt::Is(varLength))
358+
{
359+
// ToInt32 conversion on non-primitive length can invalidate assumptions made by the JIT,
360+
// so add implicit call flag if length isn't a TaggedInt already
361+
requestContext->GetThreadContext()->AddImplicitCallFlags(ImplicitCall_Accessor);
362+
}
357363
len = JavascriptConversion::ToInt32(varLength, requestContext);
358364
}
359365

0 commit comments

Comments
 (0)