[tbb-commits] [tor-browser/esr24] Bug 992968. r=efaust, a=sledru

mikeperry at torproject.org mikeperry at torproject.org
Fri Aug 29 05:26:39 UTC 2014


commit ef9950875b05a9d4e61954cd28b50db4b2879a84
Author: Nicolas B. Pierron <nicolas.b.pierron at mozilla.com>
Date:   Thu Apr 17 09:48:42 2014 -0400

    Bug 992968. r=efaust, a=sledru
---
 js/src/jit/CodeGenerator.cpp             |    3 +++
 js/src/jit/shared/CodeGenerator-shared.h |    2 ++
 2 files changed, 5 insertions(+)

diff --git a/js/src/jit/CodeGenerator.cpp b/js/src/jit/CodeGenerator.cpp
index 534ae07..4fe0327 100644
--- a/js/src/jit/CodeGenerator.cpp
+++ b/js/src/jit/CodeGenerator.cpp
@@ -91,6 +91,9 @@ class OutOfLineUpdateCache :
 bool
 CodeGeneratorShared::addCache(LInstruction *lir, size_t cacheIndex)
 {
+    if (cacheIndex == SIZE_MAX)
+        return false;
+
     IonCache *cache = static_cast<IonCache *>(getCache(cacheIndex));
     MInstruction *mir = lir->mirRaw()->toInstruction();
     if (mir->resumePoint())
diff --git a/js/src/jit/shared/CodeGenerator-shared.h b/js/src/jit/shared/CodeGenerator-shared.h
index 6fdf97a..f0a7c8b 100644
--- a/js/src/jit/shared/CodeGenerator-shared.h
+++ b/js/src/jit/shared/CodeGenerator-shared.h
@@ -203,6 +203,8 @@ class CodeGeneratorShared : public LInstructionVisitor
     template <typename T>
     inline size_t allocateCache(const T &cache) {
         size_t index = allocateCache(cache, sizeof(mozilla::AlignedStorage2<T>));
+        if (masm.oom())
+            return SIZE_MAX;
         // Use the copy constructor on the allocated space.
         new (&runtimeData_[cacheList_.back()]) T(cache);
         return index;





More information about the tbb-commits mailing list