summaryrefslogtreecommitdiff
path: root/coreconf
diff options
context:
space:
mode:
authorMartin Thomson <martin.thomson@gmail.com>2017-01-30 19:25:36 +1100
committerMartin Thomson <martin.thomson@gmail.com>2017-01-30 19:25:36 +1100
commit2816dede3b7d7f74dc14c043827694770cb26f59 (patch)
tree5d5493568b9a0dc00ab5feeb1c113d082e7f5530 /coreconf
parentfce3275cd904a681dec1b047c7da8304017fa0d0 (diff)
downloadnss-hg-2816dede3b7d7f74dc14c043827694770cb26f59.tar.gz
Bug 1329837 - mac bash doesn't have associative arrays, r=franziskus
Diffstat (limited to 'coreconf')
-rw-r--r--coreconf/sanitizers.sh12
1 files changed, 8 insertions, 4 deletions
diff --git a/coreconf/sanitizers.sh b/coreconf/sanitizers.sh
index 4e9c7034c..bd77571ed 100644
--- a/coreconf/sanitizers.sh
+++ b/coreconf/sanitizers.sh
@@ -2,14 +2,18 @@
# This file is used by build.sh to setup sanitizers.
sanitizer_flags=""
+sanitizers=()
-# This tracks what sanitizers are enabled, and their options.
-declare -A sanitizers
+# This tracks what sanitizers are enabled so they don't get enabled twice. This
+# means that doing things that enable the same sanitizer twice (such as enabling
+# both --asan and --fuzz) is order-dependent: only the first is used.
enable_sanitizer()
{
local san="$1"
- [ -n "${sanitizers[$san]}" ] && return
- sanitizers[$san]="${2:-1}"
+ for i in "${sanitizers[@]}"; do
+ [ "$san" = "$i" ] && return
+ done
+ sanitizers+=("$san")
if [ -z "$sanitizer_flags" ]; then
gyp_params+=(-Dno_zdefs=1)