Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

17-04 ChakraCore servicing release #2834

Merged
merged 2 commits into from
Apr 14, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/Runtime/Language/AsmJsUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,8 @@ namespace Js

AsmJsModuleInfo::EnsureHeapAttached(func);

uint actualArgCount = callInfo.Count - 1; // -1 for ScriptFunction
ArgumentReader reader(&callInfo, origArgs);
uint actualArgCount = reader.Info.Count - 1; // -1 for ScriptFunction
argDst = argDst + MachPtr; // add one first so as to skip the ScriptFunction argument
for (ArgSlot i = 0; i < info->GetArgCount(); i++)
{
Expand Down
8 changes: 4 additions & 4 deletions lib/Runtime/Library/JavascriptString.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,10 @@ namespace Js
}

JavascriptString::JavascriptString(StaticType * type, charcount_t charLength, const char16* szValue)
: RecyclableObject(type), m_charLength(charLength), m_pszValue(szValue)
: RecyclableObject(type), m_pszValue(szValue)
{
Assert(type->GetTypeId() == TypeIds_String);
AssertMsg(IsValidCharCount(charLength), "String length is out of range");
SetLength(charLength);
}

_Ret_range_(m_charLength, m_charLength)
Expand Down Expand Up @@ -3353,7 +3353,7 @@ namespace Js
return builder.ToString();
}

int JavascriptString::IndexOfUsingJmpTable(JmpTable jmpTable, const char16* inputStr, int len, const char16* searchStr, int searchLen, int position)
int JavascriptString::IndexOfUsingJmpTable(JmpTable jmpTable, const char16* inputStr, charcount_t len, const char16* searchStr, int searchLen, int position)
{
int result = -1;

Expand Down Expand Up @@ -3400,7 +3400,7 @@ namespace Js
return result;
}

int JavascriptString::LastIndexOfUsingJmpTable(JmpTable jmpTable, const char16* inputStr, int len, const char16* searchStr, int searchLen, int position)
int JavascriptString::LastIndexOfUsingJmpTable(JmpTable jmpTable, const char16* inputStr, charcount_t len, const char16* searchStr, charcount_t searchLen, charcount_t position)
{
const char16 searchFirst = searchStr[0];
uint32 lMatchedJump = searchLen;
Expand Down
4 changes: 2 additions & 2 deletions lib/Runtime/Library/JavascriptString.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ namespace Js
char16* GetSzCopy(); // get a copy of the inner string without compacting the chunks

static Var ToCaseCore(JavascriptString* pThis, ToCase toCase);
static int IndexOfUsingJmpTable(JmpTable jmpTable, const char16* inputStr, int len, const char16* searchStr, int searchLen, int position);
static int LastIndexOfUsingJmpTable(JmpTable jmpTable, const char16* inputStr, int len, const char16* searchStr, int searchLen, int position);
static int IndexOfUsingJmpTable(JmpTable jmpTable, const char16* inputStr, charcount_t len, const char16* searchStr, int searchLen, int position);
static int LastIndexOfUsingJmpTable(JmpTable jmpTable, const char16* inputStr, charcount_t len, const char16* searchStr, charcount_t searchLen, charcount_t position);
static bool BuildLastCharForwardBoyerMooreTable(JmpTable jmpTable, const char16* searchStr, int searchLen);
static bool BuildFirstCharBackwardBoyerMooreTable(JmpTable jmpTable, const char16* searchStr, int searchLen);
static charcount_t ConvertToIndex(Var varIndex, ScriptContext *scriptContext);
Expand Down
18 changes: 18 additions & 0 deletions test/AsmJs/evalbug.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------

function asm() {
"use asm"
function f(a, b) {
a = a|0;
b = b|0;
return a|0;
}
return f;
}

eval = asm();
eval("some string");
print("PASSED");
5 changes: 5 additions & 0 deletions test/AsmJs/rlexe.xml
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,11 @@
<compile-flags>-testtrace:asmjs -simdjs</compile-flags>
</default>
</test>
<test>
<default>
<files>evalbug.js</files>
</default>
</test>
<test>
<default>
<files>constTest.js</files>
Expand Down
21 changes: 21 additions & 0 deletions test/Strings/repeatBug.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------

try
{
var str = "+".repeat(0x80000000);
str = str.replace(str, "+");

WScript.Echo("FAIL: Was expecting Out of Memory exception.");
}
catch (e)
{
if(e.number == -2146828281) //Out of Memory
WScript.Echo("PASS");
else
WScript.Echo("FAIL: Got the wrong exception code.");
}


6 changes: 6 additions & 0 deletions test/Strings/rlexe.xml
Original file line number Diff line number Diff line change
Expand Up @@ -242,4 +242,10 @@
<tags>exclude_win7</tags>
</default>
</test>
<test>
<default>
<files>repeatBug.js</files>
<tags>exclude_chk, Slow</tags>
</default>
</test>
</regress-exe>