Bug 141258

Summary: Optimized equal() functions in StringImpl.h are not ASan compatible
Product: WebKit Reporter: Alexey Proskuryakov <ap>
Component: Web Template FrameworkAssignee: Alexey Proskuryakov <ap>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, cmarcelo, commit-queue, dbates, msaboff
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=140873
Attachments:
Description Flags
proposed fix none

Description Alexey Proskuryakov 2015-02-04 12:58:50 PST
equal() reads out of bounds; we started seeing this after the fix for bug 140873.
Comment 1 Alexey Proskuryakov 2015-02-04 13:55:12 PST
Created attachment 246045 [details]
proposed fix
Comment 2 Daniel Bates 2015-02-04 14:43:17 PST
Comment on attachment 246045 [details]
proposed fix

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

> Source/WTF/wtf/text/StringImpl.h:878
> +#if (CPU(X86_64) || CPU(ARM64)) && !ASAN_ENABLED

You may want to consider checking ASAN_ENABLED in an if-statement and changing the #if to #elif on this line such that these #if/elif/else-macro blocks look like:

#if ASAN_ENABLED
    ...
#elif CPU(X86_64) || CPU(ARM64)
    ...
...
#else
    ...
#endif

Then we do not need to add the conjunct !ASAN_ENABLED to each macro conditional expression.
Comment 3 Alexey Proskuryakov 2015-02-04 14:57:32 PST
Comment on attachment 246045 [details]
proposed fix

I wanted to keep debug-only code after production code - we usually try to keep the "best" variant first in WebKit code base.
Comment 4 WebKit Commit Bot 2015-02-04 15:38:47 PST
Comment on attachment 246045 [details]
proposed fix

Clearing flags on attachment: 246045

Committed r179644: <http://trac.webkit.org/changeset/179644>
Comment 5 WebKit Commit Bot 2015-02-04 15:38:51 PST
All reviewed patches have been landed.  Closing bug.