From 9472136272f01b858412f2d9d7854d2daa82496f Mon Sep 17 00:00:00 2001 From: Jan de Mooij Date: Tue, 10 Apr 2018 15:00:49 +0200 Subject: Bug 1444668 - Avoid allocating large AssemblerBuffers. r=luke, r=bbouvier, a=RyanVM --- js/src/jit/MacroAssembler.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'js/src/jit/MacroAssembler.cpp') diff --git a/js/src/jit/MacroAssembler.cpp b/js/src/jit/MacroAssembler.cpp index f633b9b7b9..9dbbe76242 100644 --- a/js/src/jit/MacroAssembler.cpp +++ b/js/src/jit/MacroAssembler.cpp @@ -2214,6 +2214,12 @@ MacroAssembler::finish() } MacroAssemblerSpecific::finish(); + + MOZ_RELEASE_ASSERT(size() <= MaxCodeBytesPerProcess, + "AssemblerBuffer should ensure we don't exceed MaxCodeBytesPerProcess"); + + if (bytesNeeded() > MaxCodeBytesPerProcess) + setOOM(); } void -- cgit v1.2.3