May 16, 2026
9:26 a.m.
For-loop counters and conditional comparisons hit VarAdd/VarCmp every iteration with trivial I2/I4 operands, but the full VARIANT conversion pipeline (VariantChangeType, locale grab/free in ucrtbase) dominates the cost. Short-circuit at the call site in interp.c when both operands are pure VT_I2/VT_I4: compare directly, or add via LONGLONG with native promotion (I2+I2 -> I4 on overflow, I4+I4 -> R8 on overflow). Alternative to !10528 Keeps the optimisation scoped to vbscript callers rather than adding branches to oleaut32 generic VarAdd/VarCmp. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10921