summaryrefslogtreecommitdiffstats
path: root/js/src/jit/MacroAssembler.cpp
diff options
context:
space:
mode:
authorJan de Mooij <jdemooij@mozilla.com>2018-04-10 15:00:49 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-04-19 12:01:40 +0200
commit9472136272f01b858412f2d9d7854d2daa82496f (patch)
tree3d446907848b183c3c49773ad0e976824c06d4b7 /js/src/jit/MacroAssembler.cpp
parentf243b7b4af1242c2b80726e462bac045d70c37f0 (diff)
downloadUXP-9472136272f01b858412f2d9d7854d2daa82496f.tar
UXP-9472136272f01b858412f2d9d7854d2daa82496f.tar.gz
UXP-9472136272f01b858412f2d9d7854d2daa82496f.tar.lz
UXP-9472136272f01b858412f2d9d7854d2daa82496f.tar.xz
UXP-9472136272f01b858412f2d9d7854d2daa82496f.zip
Bug 1444668 - Avoid allocating large AssemblerBuffers. r=luke, r=bbouvier, a=RyanVM
Diffstat (limited to 'js/src/jit/MacroAssembler.cpp')
-rw-r--r--js/src/jit/MacroAssembler.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/js/src/jit/MacroAssembler.cpp b/js/src/jit/MacroAssembler.cpp
index f633b9b7b..9dbbe7624 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