From 755eac8f0c722ece206eb6ad8433db6b69ce97df Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Mon, 9 Jun 2014 14:02:35 +0200 Subject: [PATCH] jscript: Properly handle NULL pvarResult in ParseScriptText. --- dlls/jscript/jscript.c | 3 ++- dlls/jscript/tests/run.c | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/dlls/jscript/jscript.c b/dlls/jscript/jscript.c index c56e6385a67..4a32c4df353 100644 --- a/dlls/jscript/jscript.c +++ b/dlls/jscript/jscript.c @@ -783,7 +783,8 @@ static HRESULT WINAPI JScriptParse_ParseScriptText(IActiveScriptParse *iface, clear_ei(This->ctx); hres = exec_source(exec_ctx, code, &code->global_code, TRUE, &r); if(SUCCEEDED(hres)) { - hres = jsval_to_variant(r, pvarResult); + if(pvarResult) + hres = jsval_to_variant(r, pvarResult); jsval_release(r); } exec_release(exec_ctx); diff --git a/dlls/jscript/tests/run.c b/dlls/jscript/tests/run.c index a92282a0d6b..dbd9b6bc870 100644 --- a/dlls/jscript/tests/run.c +++ b/dlls/jscript/tests/run.c @@ -1945,6 +1945,13 @@ static void test_script_exprs(void) hres = parse_script_expr("reportSuccess(); return true", &v); ok(hres == 0x800a03fa, "parse_script_expr failed: %08x\n", hres); + SET_EXPECT(global_success_d); + SET_EXPECT(global_success_i); + hres = parse_script_expr("reportSuccess(); true", NULL); + ok(hres == S_OK, "parse_script_expr failed: %08x\n", hres); + CHECK_CALLED(global_success_d); + CHECK_CALLED(global_success_i); + testing_expr = FALSE; }