Bug 1418844 followup - Use pre-decrement instead of post-decrement to fix leaks. r=tcampbell
authorJan de Mooij <jdemooij@mozilla.com>
Tue, 21 Nov 2017 13:42:32 +0100
changeset 392940 7954209d276dd0a864d86814679edafcb19b4cde
parent 392939 0cfaf6902748f13a602ec69c5cd6f56b7713a4e5
child 392941 cf4a2c13e779e3d55fc4d3a2a5a0257c7a12d53d
push id32946
push userccoroiu@mozilla.com
push dateTue, 21 Nov 2017 23:34:39 +0000
treeherdermozilla-central@b96f00947898 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstcampbell
bugs1418844
milestone59.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 1418844 followup - Use pre-decrement instead of post-decrement to fix leaks. r=tcampbell
js/src/jsscript.h
--- a/js/src/jsscript.h
+++ b/js/src/jsscript.h
@@ -799,17 +799,17 @@ class SharedScriptData
     uint32_t refCount() const {
         return refCount_;
     }
     void incRefCount() {
         refCount_++;
     }
     void decRefCount() {
         MOZ_ASSERT(refCount_ != 0);
-        uint32_t remain = refCount_--;
+        uint32_t remain = --refCount_;
         if (remain == 0)
             js_free(this);
     }
 
     size_t dataLength() const {
         return (natoms_ * sizeof(GCPtrAtom)) + codeLength_ + noteLength_;
     }
     const uint8_t* data() const {