http://bugs.winehq.org/show_bug.cgi?id=33059
Bug #: 33059 Summary: Visual Basic 6 shows overflow error with arithmetic expressions Product: Wine Version: 1.5.24 Platform: x86 OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown AssignedTo: wine-bugs@winehq.org ReportedBy: german_ant_82@yahoo.com Classification: Unclassified Regression SHA1: Visual Basic 6 shows overflow errors with arithmetic expressions that has results greather than 32767
When running a program or on the immediate window, Visual Basic 6 shows an overflow error with arithmetic expression that has results greather than 32767.
Dim a As Long a = 32768 <-- This doesn't cause any error a = 32767 + 1 <-- This one causes overflow error
The error message dialog shows: Run-time error '6': Overflow
This is not a normal behavior. Here, the arithmetic expressions are calculated with 16 bits binary numbers with a range from -32768 to 32767, but Visual Basic 6 is a 32 bits environment with integer expressions with a range from -4294967296 to 4294967295.
http://bugs.winehq.org/show_bug.cgi?id=33059
german_ant_82@yahoo.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |german_ant_82@yahoo.com
http://bugs.winehq.org/show_bug.cgi?id=33059
Bruno Jesus 00cpxxx@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |00cpxxx@gmail.com Regression SHA1|Visual Basic 6 shows | |overflow errors with | |arithmetic expressions that | |has results greather than | |32767 |
http://bugs.winehq.org/show_bug.cgi?id=33059
--- Comment #1 from Bruno Jesus 00cpxxx@gmail.com 2013-06-02 23:27:30 CDT --- That code crashes the application in XP too. CLng and Val does not fix it, really weird but does not seem to be a bug.
http://bugs.winehq.org/show_bug.cgi?id=33059
Bruno Jesus 00cpxxx@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |INVALID
--- Comment #2 from Bruno Jesus 00cpxxx@gmail.com 2013-06-02 23:32:06 CDT --- This is really invalid. 32767 and 1 are integers, when they are summed the operation results in an overflow. Read more at:
http://social.msdn.microsoft.com/Forums/en-US/isvvba/thread/ba933eec-7ddd-49...
This does work:
Dim a as Long a = Clng(32767) + 1
http://bugs.winehq.org/show_bug.cgi?id=33059
Bruno Jesus 00cpxxx@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #3 from Bruno Jesus 00cpxxx@gmail.com 2013-06-05 09:07:09 CDT --- Closing invalid bugs.