* commit 'ad48a4655a09811cb43d261f3f101fadfe58f695': Add support for LOCAL_DETECT_INTEGER_OVERFLOWS
This commit is contained in:
commit
fd9b5a6e5a
2 changed files with 11 additions and 0 deletions
|
@ -151,6 +151,7 @@ LOCAL_CTS_TEST_PACKAGE:=
|
|||
LOCAL_CTS_TEST_RUNNER:=
|
||||
LOCAL_CLANG:=
|
||||
LOCAL_ADDRESS_SANITIZER:=
|
||||
LOCAL_DETECT_INTEGER_OVERFLOWS:=
|
||||
LOCAL_JAR_EXCLUDE_FILES:=
|
||||
LOCAL_JAR_PACKAGES:=
|
||||
LOCAL_JAR_EXCLUDE_PACKAGES:=
|
||||
|
|
|
@ -105,3 +105,13 @@ ifneq ($(strip $(LOCAL_SANITIZE_RECOVER)),)
|
|||
recover_arg := $(subst $(space),$(comma),$(LOCAL_SANITIZE_RECOVER)),
|
||||
my_cflags += -fsanitize-recover=$(recover_arg)
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(LOCAL_DETECT_INTEGER_OVERFLOWS)),true)
|
||||
ifeq ($(my_clang),true)
|
||||
my_cflags += -fsanitize=signed-integer-overflow,unsigned-integer-overflow
|
||||
my_cflags += -ftrap-function=abort
|
||||
my_cflags += -fsanitize-undefined-trap-on-error
|
||||
else
|
||||
$(error $(LOCAL_MODULE): You must enable LOCAL_CLANG:=true to use LOCAL_DETECT_INTEGER_OVERFLOWS)
|
||||
endif
|
||||
endif
|
||||
|
|
Loading…
Reference in a new issue