diff options
author | Jan de Mooij <jdemooij@mozilla.com> | 2018-04-10 15:00:49 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-04-19 12:01:40 +0200 |
commit | 9472136272f01b858412f2d9d7854d2daa82496f (patch) | |
tree | 3d446907848b183c3c49773ad0e976824c06d4b7 /js/src/jit/shared/IonAssemblerBuffer.h | |
parent | f243b7b4af1242c2b80726e462bac045d70c37f0 (diff) | |
download | UXP-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/IonAssemblerBuffer.h')
-rw-r--r-- | js/src/jit/shared/IonAssemblerBuffer.h | 4 |
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(); |