Index: test/mjsunit/regress/regress-319722-ArrayBuffer.js |
diff --git a/test/mjsunit/regress/regress-319722-ArrayBuffer.js b/test/mjsunit/regress/regress-319722-ArrayBuffer.js |
index c8aed9e38cf7647836b68ce0428c98b7ba374d6d..1849bd2247a4750336b29e68b41bbb7d6ba2d1af 100644 |
--- a/test/mjsunit/regress/regress-319722-ArrayBuffer.js |
+++ b/test/mjsunit/regress/regress-319722-ArrayBuffer.js |
@@ -25,9 +25,20 @@ |
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
-// Flags: --nostress-opt --allow-natives-syntax |
+// Flags: --nostress-opt --allow-natives-syntax --mock-arraybuffer-allocator |
var maxSize = %MaxSmi() + 1; |
-var ab = new ArrayBuffer(maxSize); |
+var ab; |
+ |
+// Allocate the largest ArrayBuffer we can on this architecture. |
+for (k = 8; k >= 1 && ab == null; k = k/2) { |
+ try { |
+ ab = new ArrayBuffer(maxSize * k); |
+ } catch (e) { |
+ ab = null; |
+ } |
+} |
+ |
+assertTrue(ab != null); |
function TestArray(constr) { |
assertThrows(function() { |