diff options
author | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-03-25 14:48:34 +0200 |
---|---|---|
committer | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-03-25 14:48:34 +0200 |
commit | e7a220aae2dd6f92c57b92fdd08ff94e5826c035 (patch) | |
tree | 3f26d96607aaa80bcafe946f994d332e8e7cb0c5 /js/src/jit | |
parent | 6056525ced07af6c6c4f48ea605a2f4589821fdf (diff) | |
download | UXP-e7a220aae2dd6f92c57b92fdd08ff94e5826c035.tar UXP-e7a220aae2dd6f92c57b92fdd08ff94e5826c035.tar.gz UXP-e7a220aae2dd6f92c57b92fdd08ff94e5826c035.tar.lz UXP-e7a220aae2dd6f92c57b92fdd08ff94e5826c035.tar.xz UXP-e7a220aae2dd6f92c57b92fdd08ff94e5826c035.zip |
Bug 1331585 - Allow falsy "done" values for IteratorClose due to exception during array destructuring
Issue #74
Diffstat (limited to 'js/src/jit')
-rw-r--r-- | js/src/jit/JitFrames.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/js/src/jit/JitFrames.cpp b/js/src/jit/JitFrames.cpp index 30bbd0b9b..7c3f0d120 100644 --- a/js/src/jit/JitFrames.cpp +++ b/js/src/jit/JitFrames.cpp @@ -353,11 +353,11 @@ CloseLiveIteratorIon(JSContext* cx, const InlineFrameIterator& frame, JSTryNote* RootedObject iterObject(cx, &v.toObject()); if (isDestructuring) { - Value v = si.read(); - MOZ_ASSERT(v.isBoolean()); + RootedValue doneValue(cx, si.read()); + bool done = ToBoolean(doneValue); // Do not call IteratorClose if the destructuring iterator is already // done. - if (v.isTrue()) + if (done) return; } @@ -654,9 +654,9 @@ ProcessTryNotesBaseline(JSContext* cx, const JitFrameIterator& frame, Environmen uint8_t* framePointer; uint8_t* stackPointer; BaselineFrameAndStackPointersFromTryNote(tn, frame, &framePointer, &stackPointer); - Value doneValue(*(reinterpret_cast<Value*>(stackPointer))); - MOZ_ASSERT(doneValue.isBoolean()); - if (doneValue.isFalse()) { + RootedValue doneValue(cx, *(reinterpret_cast<Value*>(stackPointer))); + bool done = ToBoolean(doneValue); + if (!done) { Value iterValue(*(reinterpret_cast<Value*>(stackPointer) + 1)); RootedObject iterObject(cx, &iterValue.toObject()); if (!IteratorCloseForException(cx, iterObject)) { |