Skip to content
This repository has been archived by the owner on Oct 15, 2020. It is now read-only.

Commit

Permalink
[Merge chakra-core/ChakraCore@3747582647] [1.6>1.7] [MERGE #3384 @aga…
Browse files Browse the repository at this point in the history
…rwal-sandeep] OS#12654029: ArrayBuffer throw OOM if unable to allocate memory after GC

Merge pull request #3384 from agarwal-sandeep:vso12654029
  • Loading branch information
chakrabot authored and kfarnung committed Jul 19, 2017
1 parent 64022f1 commit eb638cc
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 44 deletions.
8 changes: 4 additions & 4 deletions deps/chakrashim/core/lib/Runtime/Library/ArrayBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -615,17 +615,17 @@ namespace Js
recycler->ReportExternalMemoryFailure(length);
}
}
else
{
JavascriptError::ThrowOutOfMemoryError(GetScriptContext());
}
}

if (buffer != nullptr)
{
bufferLength = length;
ZeroMemory(buffer, bufferLength);
}
else
{
JavascriptError::ThrowOutOfMemoryError(GetScriptContext());
}
}
}

Expand Down
33 changes: 0 additions & 33 deletions deps/chakrashim/core/test/es7/arraybuffer_constructor.js

This file was deleted.

6 changes: 0 additions & 6 deletions deps/chakrashim/core/test/es7/rlexe.xml
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,4 @@
<tags>exclude_amd64</tags>
</default>
</test>
<test>
<default>
<files>arraybuffer_constructor.js</files>
<tags>exclude_amd64</tags>
</default>
</test>
</regress-exe>
2 changes: 1 addition & 1 deletion deps/chakrashim/core/test/wasm/memory.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ test({init: 0, max: 5});
test({init: 0, max: 10});
test({init: 5});
test({init: 5, max: 10});
test({init: 1 << 14, checkOOM: true});
// test({init: 1 << 14, checkOOM: true}); // ArrayBuffer will throw OOM instead of returning a null buffer
try {
test({init: 1 << 15});
print("Failed. Expected an error when allocating WebAssembly.Memory too big");
Expand Down

0 comments on commit eb638cc

Please sign in to comment.