diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-03-25 16:33:16 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-03-25 20:39:19 +0100 |
commit | f8965272055bf9e7f3a26ff9f729d88ee856b592 (patch) | |
tree | c49386f22bc260d644c777b3128daa5bd08b79f4 | |
parent | 694e33c220e9918152aedadfcecddfceb3f5845f (diff) |
cid#1474353 experiment to silence Untrusted loop bound
Change-Id: I4436427109c92a28890a1bc7f669841c40ec2020
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113101
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | include/o3tl/safeint.hxx | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/include/o3tl/safeint.hxx b/include/o3tl/safeint.hxx index 71239d59c718..c2610edacec6 100644 --- a/include/o3tl/safeint.hxx +++ b/include/o3tl/safeint.hxx @@ -239,18 +239,11 @@ make_unsigned(T value) // tools like -fsanitize=implicit-conversion should still be able to detect truncation: template<typename T1, typename T2> constexpr T1 narrowing(T2 value) { return value; } -// std::min wrapped to inform coverity that the result is now sanitized -#if defined(__COVERITY__) -extern "C" void __coverity_tainted_data_sanitize__(void *); -#endif - +// std::min wrapped to inform coverity that the result is now deemed sanitized +// coverity[ -taint_source ] template<typename T> inline T sanitizing_min(T a, T b) { - T ret = std::min(a, b); -#if defined(__COVERITY__) - __coverity_tainted_data_sanitize__(&ret); -#endif - return ret; + return std::min(a, b); } } |