vbscript: Added interp_div implementation.

This commit is contained in:
Jacek Caban 2011-09-13 11:41:03 +02:00 committed by Alexandre Julliard
parent 8a526743a1
commit 9db2d7c352
2 changed files with 25 additions and 2 deletions

View File

@ -692,8 +692,26 @@ static HRESULT interp_idiv(exec_ctx_t *ctx)
static HRESULT interp_div(exec_ctx_t *ctx)
{
FIXME("\n");
return E_NOTIMPL;
variant_val_t r, l;
VARIANT v;
HRESULT hres;
TRACE("\n");
hres = stack_pop_val(ctx, &r);
if(FAILED(hres))
return hres;
hres = stack_pop_val(ctx, &l);
if(SUCCEEDED(hres)) {
hres = VarDiv(l.v, r.v, &v);
release_val(&l);
}
release_val(&r);
if(FAILED(hres))
return hres;
return stack_push(ctx, &v);
}
static HRESULT interp_mul(exec_ctx_t *ctx)

View File

@ -111,6 +111,11 @@ Call ok(4.6 \ 1.5 = 2, "4.6 \ 1.5 = " & (4.6\1.5))
Call ok(4.6 \ 1.49 = 5, "4.6 \ 1.49 = " & (4.6\1.49))
Call ok(2+3\4 = 2, "2+3\4 = " & (2+3\4))
Call ok(2*3 = 6, "2*3 = " & (2*3))
Call ok(3/2 = 1.5, "3/2 = " & (3/2))
Call ok(5\4/2 = 2, "5\4/2 = " & (5\2/1))
Call ok(12/3\2 = 2, "12/3\2 = " & (12/3\2))
if false then
ok false, "if false called"
end if