[UBSan][sbc] Narrow UBSAN suppression
Bug: 46738
Change-Id: I963689973734eb7b244f4845b3a74e592e617d52
diff --git a/embdrv/sbc/BUILD.gn b/embdrv/sbc/BUILD.gn
index 90f66b1..f7dd067 100644
--- a/embdrv/sbc/BUILD.gn
+++ b/embdrv/sbc/BUILD.gn
@@ -26,6 +26,14 @@
]
}
+config("undefined_behavior_shift") {
+ cflags = [ "-fno-sanitize=shift" ]
+}
+
+config("undefined_behavior_signed_integer_overflow") {
+ cflags = [ "-fno-sanitize=signed-integer-overflow" ]
+}
+
source_set("sbc_decoder") {
sources = [
"decoder/srce/alloc.c",
@@ -46,10 +54,7 @@
configs += [ ":sbc_warnings" ]
public_configs = [ ":sbc_decoder_includes_config" ]
-
- # TODO(46738): UBSan has found an instance of undefined behavior in this target.
- # Disable UBSan for this target temporarily until it is migrated into CI/CQ.
- configs += [ "//build/config:temporarily_disable_ubsan_do_not_use" ]
+ configs += [ ":undefined_behavior_shift" ]
}
config("sbc_encoder_includes_config") {
@@ -70,10 +75,10 @@
configs += [ ":sbc_warnings" ]
public_configs = [ ":sbc_encoder_includes_config" ]
-
- # TODO(46738): UBSan has found an instance of undefined behavior in this target.
- # Disable UBSan for this target temporarily until it is migrated into CI/CQ.
- configs += [ "//build/config:temporarily_disable_ubsan_do_not_use" ]
+ configs += [
+ ":undefined_behavior_shift",
+ ":undefined_behavior_signed_integer_overflow",
+ ]
}
static_library("sbc") {