[JSC] Fix incorrect assertion for VM's regexp buffer lock
authorutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 8 Apr 2018 16:47:21 +0000 (16:47 +0000)
committerutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 8 Apr 2018 16:47:21 +0000 (16:47 +0000)
https://bugs.webkit.org/show_bug.cgi?id=184398

Reviewed by Mark Lam.

isLocked check before taking a lock is incorrect.

* runtime/VM.cpp:
(JSC::VM::acquireRegExpPatternContexBuffer):

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

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/VM.cpp

index 38f2554..a7a7f89 100644 (file)
@@ -1,5 +1,17 @@
 2018-04-08  Yusuke Suzuki  <utatane.tea@gmail.com>
 
+        [JSC] Fix incorrect assertion for VM's regexp buffer lock
+        https://bugs.webkit.org/show_bug.cgi?id=184398
+
+        Reviewed by Mark Lam.
+
+        isLocked check before taking a lock is incorrect.
+
+        * runtime/VM.cpp:
+        (JSC::VM::acquireRegExpPatternContexBuffer):
+
+2018-04-08  Yusuke Suzuki  <utatane.tea@gmail.com>
+
         [JSC] Introduce op_get_by_id_direct
         https://bugs.webkit.org/show_bug.cgi?id=183970
 
index 7ad510f..c9a24ec 100644 (file)
@@ -901,9 +901,8 @@ void logSanitizeStack(VM* vm)
 #if ENABLE(YARR_JIT_ALL_PARENS_EXPRESSIONS)
 char* VM::acquireRegExpPatternContexBuffer()
 {
-    ASSERT(!m_regExpPatternContextLock.isLocked());
-
     m_regExpPatternContextLock.lock();
+    ASSERT(m_regExpPatternContextLock.isLocked());
     if (!m_regExpPatternContexBuffer)
         m_regExpPatternContexBuffer = makeUniqueArray<char>(VM::patternContextBufferSize);
     return m_regExpPatternContexBuffer.get();