From f8f86a1a8172fa8b66ffaf7e04c0b723ee2b4866 Mon Sep 17 00:00:00 2001 From: Kornel Benko Date: Sun, 23 Jan 2022 20:13:26 +0100 Subject: [PATCH] Next runtime messages to be ommitted if compiled with clang using flag '-fsanitize'. Prevent the return of impossible values for 'enum flags'. For instance the result of '~Update::Force' at src/BufferView.cpp:3025 without this patch is '4294967293'. --- src/update_flags.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/update_flags.h b/src/update_flags.h index 0efa541122..517bfb62e4 100644 --- a/src/update_flags.h +++ b/src/update_flags.h @@ -46,7 +46,7 @@ inline flags operator&(flags const f, flags const g) inline flags operator~(flags const f) { - return static_cast(~int(f)); + return static_cast(~int(f) & 0x3f); } } // namespace Update -- 2.39.5