summaryrefslogtreecommitdiffstats
path: root/js/src/jit/shared
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/shared
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/shared')
-rw-r--r--js/src/jit/shared/IonAssemblerBuffer.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/js/src/jit/shared/IonAssemblerBuffer.h b/js/src/jit/shared/IonAssemblerBuffer.h
index cc20e26d2..3a6552696 100644
--- a/js/src/jit/shared/IonAssemblerBuffer.h
+++ b/js/src/jit/shared/IonAssemblerBuffer.h
@@ -181,6 +181,10 @@ class AssemblerBuffer
protected:
virtual Slice* newSlice(LifoAlloc& a) {
+ if (size() > MaxCodeBytesPerProcess - sizeof(Slice)) {
+ fail_oom();
+ return nullptr;
+ }
Slice* tmp = static_cast<Slice*>(a.alloc(sizeof(Slice)));
if (!tmp) {
fail_oom();