1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/mozglue/build/AsanOptions.cpp Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,24 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this file, 1.7 + * You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#include "mozilla/Attributes.h" 1.10 + 1.11 +// When running with AddressSanitizer, we need to explicitely set some 1.12 +// options specific to our codebase to prevent errors during runtime. 1.13 +// 1.14 +// Currently, these are: 1.15 +// 1.16 +// allow_user_segv_handler=1 - Tell ASan to allow our code to use its 1.17 +// own SIGSEGV handlers. This is required by ASM.js internally. 1.18 +// 1.19 +// alloc_dealloc_mismatch=0 - Disable alloc-dealloc mismatch checking 1.20 +// in ASan. This is required because we define our own new/delete 1.21 +// operators that are backed by malloc/free. If one of them gets inlined 1.22 +// while the other doesn't, ASan will report false positives. 1.23 +// 1.24 +extern "C" MOZ_ASAN_BLACKLIST 1.25 +const char* __asan_default_options() { 1.26 + return "allow_user_segv_handler=1:alloc_dealloc_mismatch=0"; 1.27 +}