From 4916c1b26ce096e83cda7c34818e06e1306241cf Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Wed, 14 Sep 2011 12:59:37 +0200 Subject: [PATCH] vbscript: Added interp_or implementation. --- dlls/vbscript/interp.c | 22 ++++++++++++++++++++-- dlls/vbscript/tests/lang.vbs | 6 ++++++ 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/dlls/vbscript/interp.c b/dlls/vbscript/interp.c index e55d3285553..73165013cff 100644 --- a/dlls/vbscript/interp.c +++ b/dlls/vbscript/interp.c @@ -590,8 +590,26 @@ static HRESULT interp_and(exec_ctx_t *ctx) static HRESULT interp_or(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 = VarOr(l.v, r.v, &v); + release_val(&l); + } + release_val(&r); + if(FAILED(hres)) + return hres; + + return stack_push(ctx, &v); } static HRESULT cmp_oper(exec_ctx_t *ctx) diff --git a/dlls/vbscript/tests/lang.vbs b/dlls/vbscript/tests/lang.vbs index 69aeadef4f6..c6a336d36e5 100644 --- a/dlls/vbscript/tests/lang.vbs +++ b/dlls/vbscript/tests/lang.vbs @@ -91,6 +91,12 @@ call ok(true and not false, "true and not false is not true") call ok(not (false and true), "not (false and true) is not true") call ok(getVT(null and true) = "VT_NULL", "getVT(null and true) = " & getVT(null and true)) +call ok(false or true, "false or uie is false?") +call ok(not (false or false), "false or false is not false?") +call ok(false and false or true, "false and false or true is false?") +call ok(true or false and false, "true or false and false is false?") +call ok(null or true, "null or true is false") + x = 3 Call ok(2+2 = 4, "2+2 = " & (2+2)) Call ok(false + 6 + true = 5, "false + 6 + true <> 5")