Module: wine Branch: master Commit: 755eac8f0c722ece206eb6ad8433db6b69ce97df URL: http://source.winehq.org/git/wine.git/?a=commit;h=755eac8f0c722ece206eb6ad84...
Author: Jacek Caban jacek@codeweavers.com Date: Mon Jun 9 14:02:35 2014 +0200
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 c56e638..4a32c4d 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 a92282a..dbd9b6b 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; }