Bug 1092110: Fix a signed/unsigned comparison in JitcodeMap; r=dougc
authorBenjamin Bouvier <benj@benj.me>
Tue, 04 Nov 2014 15:30:30 +0100
changeset 238241 81998c8897661b177283a96e12e4c6bca4a62f45
parent 238240 dfd2eb97d840d0f1c892af469eecf5fa74ff1826
child 238242 9c0efc3d1207ffe3135a54ab963629bb736d304d
push id4311
push userraliiev@mozilla.com
push dateMon, 12 Jan 2015 19:37:41 +0000
treeherdermozilla-beta@150c9fed433b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdougc
bugs1092110
milestone36.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1092110: Fix a signed/unsigned comparison in JitcodeMap; r=dougc
js/src/jit/JitcodeMap.cpp
--- a/js/src/jit/JitcodeMap.cpp
+++ b/js/src/jit/JitcodeMap.cpp
@@ -9,17 +9,17 @@
 #include "mozilla/DebugOnly.h"
 #include "jit/BaselineJIT.h"
 #include "jit/JitSpewer.h"
 
 #include "js/Vector.h"
 
 namespace js {
 namespace jit {
- 
+
 bool
 JitcodeGlobalEntry::IonEntry::callStackAtAddr(JSRuntime *rt, void *ptr,
                                               BytecodeLocationVector &results,
                                               uint32_t *depth) const
 {
     MOZ_ASSERT(containsPointer(ptr));
     uint32_t ptrOffset = reinterpret_cast<uint8_t *>(ptr) -
                          reinterpret_cast<uint8_t *>(nativeStartAddr());
@@ -657,17 +657,17 @@ JitcodeIonTable::WriteIonTable(CompactBu
     // start to the run.
     const CodeGeneratorShared::NativeToBytecode *curEntry = start;
     js::Vector<uint32_t, 32, SystemAllocPolicy> runOffsets;
 
     while (curEntry != end) {
         // Calculate the length of the next run.
         uint32_t runLength = JitcodeRegionEntry::ExpectedRunLength(curEntry, end);
         MOZ_ASSERT(runLength > 0);
-        MOZ_ASSERT(runLength <= (end - curEntry));
+        MOZ_ASSERT(runLength <= uintptr_t(end - curEntry));
         JitSpew(JitSpew_Profiling, "  Run at entry %d, length %d, buffer offset %d",
                 int(curEntry - start), int(runLength), int(writer.length()));
 
         // Store the offset of the run.
         if (!runOffsets.append(writer.length()))
             return false;
 
         // Encode the run.