diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-01 13:05:01 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-04-01 14:05:37 +0200 |
commit | b57d04083a807c96e03d75655c206d4f2c415104 (patch) | |
tree | acb5b971f255e6b2d4e1fb213e97aa55dc5ef361 /include | |
parent | 0e3023564f58c70af47155675a43c1540d20ad65 (diff) |
fix ubsan after 7d6c67d323a87f1006d84c2a95b45dfbfb03c0c8
ubsan exposed some bugs in
commit 7d6c67d323a87f1006d84c2a95b45dfbfb03c0c8
Date: Mon Mar 30 15:11:55 2020 +0200
convert enum to scoped in SvBaseLink
where I had converted the bit operations incorrectly
Change-Id: I85bc0f0d69c34d9d714f983f82d4d26dd967f892
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91484
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include')
-rw-r--r-- | include/sfx2/lnkbase.hxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/sfx2/lnkbase.hxx b/include/sfx2/lnkbase.hxx index c3b981afebfe..ca29ebe3547e 100644 --- a/include/sfx2/lnkbase.hxx +++ b/include/sfx2/lnkbase.hxx @@ -65,7 +65,8 @@ constexpr bool isClientType(SvBaseLinkObjectType t) } constexpr bool isClientFileType(SvBaseLinkObjectType t) { - return static_cast<int>(t) & static_cast<int>(SvBaseLinkObjectType::ClientFile); + auto check = static_cast<int>(SvBaseLinkObjectType::ClientFile); + return (static_cast<int>(t) & check) == check; } struct BaseLink_Impl; |