Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeHolman committed May 13, 2019
1 parent 32ca10f commit a2deba5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/Runtime/Library/ES5Array.cpp
Expand Up @@ -148,6 +148,10 @@ namespace Js
{
JavascriptError::ThrowRangeError(scriptContext, JSERR_ArrayLengthAssignIncorrect);
}

// Conversion can change the type (e.g. from String), invalidating assumptions made by the JIT
scriptContext->GetThreadContext()->AddImplicitCallFlags(ImplicitCall_Accessor);

return newLen;
}
}
Expand Down
3 changes: 3 additions & 0 deletions lib/Runtime/Library/JavascriptArray.cpp
Expand Up @@ -2930,6 +2930,9 @@ using namespace Js;
double dblValue = JavascriptConversion::ToNumber(newLength, scriptContext);
if (dblValue == uintValue)
{
// Conversion can change the type (e.g. from String), invalidating assumptions made by the JIT
scriptContext->GetThreadContext()->AddImplicitCallFlags(ImplicitCall_Accessor);

this->SetLength(uintValue);
}
else
Expand Down

0 comments on commit a2deba5

Please sign in to comment.