[Libreoffice-commits] core.git: include/xmloff

Stephan Bergmann sbergman at redhat.com
Tue Aug 30 08:01:26 UTC 2016


 include/xmloff/xmltkmap.hxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 11cc9bdc21be241f2feb3ab4822d9d365dba4f96
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Aug 30 09:56:27 2016 +0200

    Avoid UBSan "left shift of 65536 by 16 places cannot be represented...
    
    ...in type 'int'" warning when constructing an XML_TOKEN_MAP_END instance, whose
    nPrefixKey is 0xffffU.  Problem got introduced with
    41b3fd8ca54eff7e71c69bb0b60e63016f1ac8c2 "Make SvXMLTokenMap compatible with
    FastTokens", the intent was presumably to make the shifted value of
    
      ( nPrefixKey + 1 ) << 16
    
    be zero in that case.
    
    Change-Id: I0b83a03198a44e54077899e4484634286d06cdcc

diff --git a/include/xmloff/xmltkmap.hxx b/include/xmloff/xmltkmap.hxx
index 2953dac..89cfd65 100644
--- a/include/xmloff/xmltkmap.hxx
+++ b/include/xmloff/xmltkmap.hxx
@@ -44,7 +44,7 @@ struct SvXMLTokenMapEntry
         nPrefixKey( nPrefix ),
         eLocalName( eName ),
         nToken( nTok ),
-        nFastToken( ( nPrefixKey + 1 ) << 16 | eLocalName )
+        nFastToken( sal_uInt32( nPrefixKey + 1 ) << 16 | eLocalName )
     {
         if ( nFastTok )     // alternative value for duplicate/dummy tokens
             nFastToken = nFastTok;


More information about the Libreoffice-commits mailing list