44483ede
by Francis De Brabandere at 2026-04-07T17:03:29+02:00
vbscript: Fix For loop getting stuck when expression evaluation fails with On Error Resume Next.
When a For..To loop's bound expression fails (e.g. UBound on Empty) and
On Error Resume Next is active, the error handler fills the step/to stack
slots with VT_EMPTY. On the next iteration, VarCmp fails on these values
and the error propagates back into the loop, causing an infinite loop.
Fix this by handling VarCmp failures in interp_step: exit the loop and
report error 92 (For loop not initialized). Also make interp_incc ignore
VarAdd failures so execution reaches interp_step for proper cleanup.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54291