[Libreoffice-bugs] [Bug 141034] Crash entire application on syntax error in basic

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Fri Mar 19 17:58:05 UTC 2021


https://bugs.documentfoundation.org/show_bug.cgi?id=141034

himajin100000 at gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andreas.heinisch at yahoo.de

--- Comment #5 from himajin100000 at gmail.com ---
not reproducible on 

Version: 7.2.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 6e4238018bf0408f2961e5708212e09a8c3597dc
CPU threads: 4; OS: Windows 10.0 Build 19042; UI render: default; VCL: win
Locale: ja-JP (ja_JP); UI: en-US
Calc: CL

When I ran Main() the values displayed were
0
false 

---
Function myResult (toTest as string) as boolean
   if ( toTest = "TEST" ) then
       myResult - true   REM should be =
   else
       myResult = false
   end if
End function

Sub Main()
Msgbox(true + 1)
Msgbox(myResult("TEST"))
End Sub
---

At least in my experiment, function call seemed callable without parentheses,
and the constant true is of value -1

so the code is parsed as 
myResult( - true )

which is equivalent to 

myResult( - (-1) )

so

myResult( 1 )

As the first parameter of myResult is of type String,
"1" was assigned to toTest, executing the following line, which is of course
correct.

myResult = false

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20210319/493d8d6c/attachment-0001.htm>


More information about the Libreoffice-bugs mailing list