]> git.lyx.org Git - lyx.git/commitdiff
Next runtime messages to be ommitted if compiled with clang using flag '-fsanitize'.
authorKornel Benko <kornel@lyx.org>
Sun, 23 Jan 2022 19:13:26 +0000 (20:13 +0100)
committerKornel Benko <kornel@lyx.org>
Sun, 23 Jan 2022 19:13:26 +0000 (20:13 +0100)
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

index 0efa54112223e25e69af9c178031f9f8d6084fa6..517bfb62e4ee9a64e7b4c1961a087c08fd11c369 100644 (file)
@@ -46,7 +46,7 @@ inline flags operator&(flags const f, flags const g)
 
 inline flags operator~(flags const f)
 {
-       return static_cast<flags>(~int(f));
+       return static_cast<flags>(~int(f) & 0x3f);
 }
 
 } // namespace Update