Bug 100437

Summary: SymbolTableIndexHashTraits::needsDestruction should be set to true
Product: WebKit Reporter: Michael Saboff <msaboff>
Component: JavaScriptCoreAssignee: Michael Saboff <msaboff>
Status: RESOLVED FIXED    
Severity: Normal CC: webkit.review.bot
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch none

Description Michael Saboff 2012-10-25 17:16:12 PDT
Due to the use of allocated rare data (FatEntry's) in SymbolTableEntry's, the hash trait needsDestruction should be set to true.  The code is currently working due to the Key trait, HashTraits<RefPtr<StringImpl> > having needsDestruction set true.  If the key or it's trait is set to false, then this would leak memory.
Comment 1 Michael Saboff 2012-10-25 17:17:07 PDT
<rdar://problem/12350394>
Comment 2 Michael Saboff 2012-10-25 17:32:34 PDT
Created attachment 170771 [details]
Patch
Comment 3 Mark Hahnenberg 2012-10-25 17:36:17 PDT
Comment on attachment 170771 [details]
Patch

r=me
Comment 4 WebKit Review Bot 2012-10-25 20:28:45 PDT
Comment on attachment 170771 [details]
Patch

Clearing flags on attachment: 170771

Committed r132566: <http://trac.webkit.org/changeset/132566>
Comment 5 WebKit Review Bot 2012-10-25 20:28:48 PDT
All reviewed patches have been landed.  Closing bug.
Comment 6 Darin Adler 2012-10-26 09:21:14 PDT
Comment on attachment 170771 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=170771&action=review

> Source/JavaScriptCore/runtime/SymbolTable.h:340
> -        static const bool needsDestruction = false;
> +        static const bool needsDestruction = true;

A simpler correct fix is to simply remove this line entirely. It is true by default for structs, so no need to explicitly set it to true.