https://bugs.winehq.org/show_bug.cgi?id=54291
Bug ID: 54291 Summary: vbscript stuck in endless for loop when UBound on Empty and On Error Resume Next Product: Wine Version: 7.21 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: vbscript Assignee: wine-bugs@winehq.org Reporter: jsm174@gmail.com Distribution: ---
I ran across some code similar to the following:
WScript.echo "Start"
Dim ii Dim tmp
Dim vpmMultiLights() : ReDim vpmMultiLights(0)
On Error Resume Next
For Each tmp In vpmMultiLights For ii = 1 To UBound(tmp) : tmp(ii).State = tmp(0).State : Next Next
On Error Goto 0
WScript.echo "Done"
In real vbscript, the result is:
Start Done
In wine vbscript, this code will get stuck in an endless loop.
To work around this I hacked UBound to return 0 with VT_EMPTY, but I think real vbscript treats this differently.
https://bugs.winehq.org/show_bug.cgi?id=54291
--- Comment #1 from Nikolay Sivov bunglehead@gmail.com --- Actual error code should be 13 (type mismatch), and we should fix that. However the real issue is likely wrong jump that happens on error. Maybe error in loop bounds are not handled correctly. It gets stuck in inner loop, right?
https://bugs.winehq.org/show_bug.cgi?id=54291
--- Comment #2 from Jason Millard jsm174@gmail.com --- Correct, the inner loop.
https://bugs.winehq.org/show_bug.cgi?id=54291
Robert Wilhelm sloper42@yahoo.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |sloper42@yahoo.com Ever confirmed|0 |1 Status|UNCONFIRMED |NEW
--- Comment #3 from Robert Wilhelm sloper42@yahoo.com --- After https://gitlab.winehq.org/wine/wine/-/commit/f23a50d1db59aafce76fba64a798041... we get now type mismatch for UBound(Empty). Exception handling still needs to be fixed. There are already some FIXMEs in compile.c compile_forto_statement().
https://bugs.winehq.org/show_bug.cgi?id=54291
--- Comment #4 from Jason Millard jsm174@gmail.com --- (In reply to Robert Wilhelm from comment #3)
After https://gitlab.winehq.org/wine/wine/-/commit/ f23a50d1db59aafce76fba64a7980417feb74679 we get now type mismatch for UBound(Empty). Exception handling still needs to be fixed. There are already some FIXMEs in compile.c compile_forto_statement().
Awesome. Thanks for fixing the first part of this!