Kaydet (Commit) 4c9a08e7 authored tarafından Noel Power's avatar Noel Power

fix for fdo#62323 bad conversion of Hex strings for certain values

Basic hex literals are basic Integer ( e.g. 4 byte ) types with
-2,147,483,648 through 2,147,483,647 range. Interally the scanner
was using a long to form/scan the literal, this led to bad behaviour
on 64bit linux ( where normally long -> 8 bytes )

Change-Id: I1d0fcc55ed0eda636da1445329737d1684e69f33
üst 2d95a1bf
'
' This file is part of the LibreOffice project.
'
' This Source Code Form is subject to the terms of the Mozilla Public
' License, v. 2.0. If a copy of the MPL was not distributed with this
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
Function doUnitTest as Integer
Dim lngDecimal as Long
lngDecimal = Clng(&HFFFFFFFF)
If lngDecimal = -1 Then
doUnitTest = 1
Else
doUnitTest = 0
End If
End Function
'
' This file is part of the LibreOffice project.
'
' This Source Code Form is subject to the terms of the Mozilla Public
' License, v. 2.0. If a copy of the MPL was not distributed with this
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
Function doUnitTest as Integer
Dim lngDecimal as Long
lngDecimal = Clng(&HFFFFFFFF)
If lngDecimal = -1 Then
doUnitTest = 1
Else
doUnitTest = 0
End If
End Function
'
' This file is part of the LibreOffice project.
'
' This Source Code Form is subject to the terms of the Mozilla Public
' License, v. 2.0. If a copy of the MPL was not distributed with this
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
Function doUnitTest as Integer
Dim lngDecimal as Long
lngDecimal = Clng(&H80000000)
If lngDecimal = -2147483648 Then
doUnitTest = 1
Else
doUnitTest = 0
End If
End Function
'
' This file is part of the LibreOffice project.
'
' This Source Code Form is subject to the terms of the Mozilla Public
' License, v. 2.0. If a copy of the MPL was not distributed with this
' file, You can obtain one at http://mozilla.org/MPL/2.0/.
'
Function doUnitTest as Integer
Dim lngDecimal as Long
lngDecimal = Clng(&H0)
If lngDecimal = 0 Then
doUnitTest = 1
Else
doUnitTest = 0
End If
End Function
...@@ -413,7 +413,9 @@ bool SbiScanner::NextSym() ...@@ -413,7 +413,9 @@ bool SbiScanner::NextSym()
return true; return true;
} }
bNumber = true; bNumber = true;
long l = 0; // Hex literals are signed Integers ( as defined by basic
// e.g. -2,147,483,648 through 2,147,483,647 (signed)
sal_Int32 l = 0;
int i; int i;
bool bBufOverflow = false; bool bBufOverflow = false;
while(nCol < aLine.getLength() && theBasicCharClass::get().isAlphaNumeric(aLine[nCol] & 0xFF, bCompatible)) while(nCol < aLine.getLength() && theBasicCharClass::get().isAlphaNumeric(aLine[nCol] & 0xFF, bCompatible))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment