Commit 292b61f5 authored by Daniel Remenak's avatar Daniel Remenak Committed by Alexandre Julliard

Return DISP_E_DIVBYZERO instead of crashing when asked to divide a

variant by zero.
parent 7376f57c
......@@ -3008,11 +3008,13 @@ HRESULT WINAPI VarDiv(LPVARIANT left, LPVARIANT right, LPVARIANT result)
}
switch (resvt) {
case VT_R8:
if (V_R8(&rv) == 0) return DISP_E_DIVBYZERO;
V_VT(result) = resvt;
V_R8(result) = V_R8(&lv) / V_R8(&rv);
rc = S_OK;
break;
case VT_I4:
if (V_I4(&rv) == 0) return DISP_E_DIVBYZERO;
V_VT(result) = resvt;
V_I4(result) = V_I4(&lv) / V_I4(&rv);
rc = S_OK;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment