Bug 140130 - ADDRESS_SANITIZER macro is overloaded
Summary: ADDRESS_SANITIZER macro is overloaded
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alexey Proskuryakov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-06 10:48 PST by Alexey Proskuryakov
Modified: 2015-01-06 14:24 PST (History)
6 users (show)

See Also:


Attachments
proposed fix (7.15 KB, patch)
2015-01-06 10:53 PST, Alexey Proskuryakov
andersca: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Proskuryakov 2015-01-06 10:48:06 PST
ADDRESS_SANITIZER macro is used for two purposes:

- conditional compilation of code when ASan is enabled;
- enabling security checks, whether ASan is enabled or not.
Comment 1 Alexey Proskuryakov 2015-01-06 10:53:23 PST
Created attachment 244074 [details]
proposed fix
Comment 2 Anders Carlsson 2015-01-06 13:36:24 PST
Comment on attachment 244074 [details]
proposed fix

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

> Source/WTF/wtf/Compiler.h:143
> +#if defined(__has_feature)
> +#define ASAN_ENABLED __has_feature(address_sanitizer)
> +#else
> +#define ASAN_ENABLED false
> +#endif

Maybe this should be #define ENABLE_ASAN? so #if ENABLE(ASAN) could be used?
Comment 3 Alexey Proskuryakov 2015-01-06 14:13:13 PST
ENABLE() macros are for things that can be enabled by defining the macro, which is why I intentionally stayed away from using this form - ASan won't appear if you pass -DENABLE_ASAN.
Comment 4 Alexey Proskuryakov 2015-01-06 14:24:46 PST
Committed <http://trac.webkit.org/r177995>.