Unreviewed, follow-up fix for tls->size() access
authorysuzuki@apple.com <ysuzuki@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 23 Jul 2019 00:18:36 +0000 (00:18 +0000)
committerysuzuki@apple.com <ysuzuki@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 23 Jul 2019 00:18:36 +0000 (00:18 +0000)
https://bugs.webkit.org/show_bug.cgi?id=200019

* bmalloc/IsoTLS.cpp:
(bmalloc::IsoTLS::ensureEntries):
(bmalloc::IsoTLS::destructor):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@247711 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/bmalloc/ChangeLog
Source/bmalloc/bmalloc/IsoTLS.cpp

index d85d748..6e5948a 100644 (file)
@@ -1,5 +1,14 @@
 2019-07-22  Yusuke Suzuki  <ysuzuki@apple.com>
 
+        Unreviewed, follow-up fix for tls->size() access
+        https://bugs.webkit.org/show_bug.cgi?id=200019
+
+        * bmalloc/IsoTLS.cpp:
+        (bmalloc::IsoTLS::ensureEntries):
+        (bmalloc::IsoTLS::destructor):
+
+2019-07-22  Yusuke Suzuki  <ysuzuki@apple.com>
+
         [bmalloc] IsoTLS is not deallocated in TLS destructor
         https://bugs.webkit.org/show_bug.cgi?id=200019
 
index 5f4306d..0dec3de 100644 (file)
@@ -114,8 +114,9 @@ IsoTLS* IsoTLS::ensureEntries(unsigned offset)
                     entry->move(src, dst);
                     entry->destruct(src);
                 });
+            size_t oldSize = tls->size();
             tls->~IsoTLS();
-            vmDeallocate(tls, tls->size());
+            vmDeallocate(tls, oldSize);
         }
         tls = newTLS;
         set(tls);
@@ -142,8 +143,9 @@ void IsoTLS::destructor(void* arg)
             entry->scavenge(data);
             entry->destruct(data);
         });
+    size_t oldSize = tls->size();
     tls->~IsoTLS();
-    vmDeallocate(tls, tls->size());
+    vmDeallocate(tls, oldSize);
 }
 
 size_t IsoTLS::sizeForCapacity(unsigned capacity)