Skip to content

Commit 466de35

Browse files
committed
Leak of VectorBufferBase.m_buffer (16-64 bytes) under JSC::CompactVariableEnvironment in com.apple.WebKit.WebContent running layout tests
<https://webkit.org/b/193264> <rdar://problem/46651026> Reviewed by Yusuke Suzuki. * parser/VariableEnvironment.cpp: (JSC::CompactVariableMap::Handle::~Handle): Call delete on m_environment instead of fastFree() to make sure the destructors for the Vector instance variables are run. This fixes the leaks because calling fastFree() would only free the CompactVariableEnvironment object, but not the heap-based buffers allocated for the Vector instance variables. Canonical link: https://commits.webkit.org/207766@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239755 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent e74e73d commit 466de35

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

‎Source/JavaScriptCore/ChangeLog‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
2019-01-08 David Kilzer <ddkilzer@apple.com>
2+
3+
Leak of VectorBufferBase.m_buffer (16-64 bytes) under JSC::CompactVariableEnvironment in com.apple.WebKit.WebContent running layout tests
4+
<https://webkit.org/b/193264>
5+
<rdar://problem/46651026>
6+
7+
Reviewed by Yusuke Suzuki.
8+
9+
* parser/VariableEnvironment.cpp:
10+
(JSC::CompactVariableMap::Handle::~Handle): Call delete on
11+
m_environment instead of fastFree() to make sure the destructors
12+
for the Vector instance variables are run. This fixes the leaks
13+
because calling fastFree() would only free the
14+
CompactVariableEnvironment object, but not the heap-based
15+
buffers allocated for the Vector instance variables.
16+
117
2019-01-08 Joseph Pecoraro <pecoraro@apple.com>
218

319
ASSERT when paused in debugger and console evaluation causes exception

‎Source/JavaScriptCore/parser/VariableEnvironment.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ CompactVariableMap::Handle::~Handle()
179179
if (!iter->value) {
180180
ASSERT(m_environment == &iter->key.environment());
181181
m_map->m_map.remove(iter);
182-
fastFree(m_environment);
182+
delete m_environment;
183183
}
184184
}
185185

0 commit comments

Comments
 (0)