winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
December 2011
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
810 discussions
Start a n
N
ew thread
Jacek Caban : jscript: Use bytecode for invalid assignments.
by Alexandre Julliard
05 Dec '11
05 Dec '11
Module: wine Branch: master Commit: 8511797c07578cd13587ad6cd652712bcb038531 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8511797c07578cd13587ad6cd…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Dec 5 11:12:32 2011 +0100 jscript: Use bytecode for invalid assignments. --- dlls/jscript/compile.c | 23 +++++++++++++++++++++-- dlls/jscript/engine.c | 43 +++++++++---------------------------------- dlls/jscript/engine.h | 2 +- dlls/jscript/tests/api.js | 12 ++++++++++++ 4 files changed, 43 insertions(+), 37 deletions(-) diff --git a/dlls/jscript/compile.c b/dlls/jscript/compile.c index 93d780f..73f57ee 100644 --- a/dlls/jscript/compile.c +++ b/dlls/jscript/compile.c @@ -172,6 +172,18 @@ static HRESULT push_instr_double(compiler_ctx_t *ctx, jsop_t op, double arg) return S_OK; } +static HRESULT push_instr_uint(compiler_ctx_t *ctx, jsop_t op, unsigned arg) +{ + unsigned instr; + + instr = push_instr(ctx, op); + if(instr == -1) + return E_OUTOFMEMORY; + + instr_ptr(ctx, instr)->arg1.uint = arg; + return S_OK; +} + static HRESULT compile_binary_expression(compiler_ctx_t *ctx, binary_expression_t *expr, jsop_t op) { HRESULT hres; @@ -390,8 +402,15 @@ static HRESULT compile_assign_expression(compiler_ctx_t *ctx, binary_expression_ break; } default: - expr->expr.eval = assign_expression_eval; - return compile_interp_fallback(ctx, &expr->expr); + hres = compile_expression(ctx, expr->expression1); + if(FAILED(hres)) + return hres; + + hres = compile_expression(ctx, expr->expression2); + if(FAILED(hres)) + return hres; + + return push_instr_uint(ctx, OP_throw, JS_E_ILLEGAL_ASSIGN); } diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c index 2af2d75..124b7b0 100644 --- a/dlls/jscript/engine.c +++ b/dlls/jscript/engine.c @@ -1279,6 +1279,15 @@ HRESULT throw_statement_eval(script_ctx_t *ctx, statement_t *_stat, return_type_ return DISP_E_EXCEPTION; } +static HRESULT interp_throw(exec_ctx_t *ctx) +{ + const HRESULT arg = ctx->parser->code->instrs[ctx->ip].arg1.uint; + + TRACE("%08x\n", arg); + + return throw_reference_error(ctx->parser->script, &ctx->ei, arg, NULL); +} + /* ECMA-262 3rd Edition 12.14 */ static HRESULT catch_eval(script_ctx_t *ctx, catch_block_t *block, return_type_t *rt, VARIANT *ret) { @@ -3308,40 +3317,6 @@ HRESULT right2_shift_expression_eval(script_ctx_t *ctx, expression_t *_expr, DWO } /* ECMA-262 3rd Edition 11.13.1 */ -HRESULT assign_expression_eval(script_ctx_t *ctx, expression_t *_expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) -{ - binary_expression_t *expr = (binary_expression_t*)_expr; - exprval_t exprval, exprvalr; - VARIANT rval; - HRESULT hres; - - TRACE("\n"); - - hres = expr_eval(ctx, expr->expression1, EXPR_NEWREF, ei, &exprval); - if(FAILED(hres)) - return hres; - - hres = expr_eval(ctx, expr->expression2, 0, ei, &exprvalr); - if(SUCCEEDED(hres)) { - hres = exprval_to_value(ctx, &exprvalr, ei, &rval); - exprval_release(&exprvalr); - } - - if(SUCCEEDED(hres)) { - assert(exprval.type != EXPRVAL_IDREF); - return throw_reference_error(ctx, ei, JS_E_ILLEGAL_ASSIGN, NULL); - } - - exprval_release(&exprval); - if(FAILED(hres)) - return hres; - - ret->type = EXPRVAL_VARIANT; - ret->u.var = rval; - return S_OK; -} - -/* ECMA-262 3rd Edition 11.13.1 */ static HRESULT interp_assign(exec_ctx_t *ctx) { IDispatch *disp; diff --git a/dlls/jscript/engine.h b/dlls/jscript/engine.h index a032f7b..0825649 100644 --- a/dlls/jscript/engine.h +++ b/dlls/jscript/engine.h @@ -76,6 +76,7 @@ typedef struct _func_stack { X(regexp, 1, ARG_STR, ARG_INT) \ X(str, 1, ARG_STR, 0) \ X(this, 1, 0,0) \ + X(throw, 0, ARG_UINT, 0) \ X(tonum, 1, 0,0) \ X(tree, 1, ARG_EXPR, 0) \ X(ret, 0, 0,0) \ @@ -570,7 +571,6 @@ HRESULT pre_decrement_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept HRESULT left_shift_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; HRESULT right_shift_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; HRESULT right2_shift_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; -HRESULT assign_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; HRESULT assign_lshift_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; HRESULT assign_rshift_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; HRESULT assign_rrshift_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; diff --git a/dlls/jscript/tests/api.js b/dlls/jscript/tests/api.js index b5ac66a..0118743 100644 --- a/dlls/jscript/tests/api.js +++ b/dlls/jscript/tests/api.js @@ -2076,6 +2076,18 @@ tmp = false; testException(function() {test = (tmp = true);}, "E_ILLEGAL_ASSIGN"); ok(tmp, "expr value on invalid assign not evaluated"); +tmp = false; +testException(function() {(tmp = true) = false;}, "E_ILLEGAL_ASSIGN"); +ok(tmp, "expr assign not evaluated"); + +tmp = false; +testException(function() {true = (tmp = true);}, "E_ILLEGAL_ASSIGN"); +ok(tmp, "expr value assign not evaluated"); + +tmp = ""; +testException(function() {(tmp = tmp+"1") = (tmp = tmp+"2");}, "E_ILLEGAL_ASSIGN"); +ok(tmp === "12", "assign evaluated in unexpected order"); + // RegExpError tests testException(function() {RegExp(/a/, "g");}, "E_REGEXP_SYNTAX_ERROR");
1
0
0
0
Jacek Caban : jscript: Use bytecode for assignment to member expression.
by Alexandre Julliard
05 Dec '11
05 Dec '11
Module: wine Branch: master Commit: 5b2c2c5cf924ca8d99ce132b1f58e7f260dd2a7b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5b2c2c5cf924ca8d99ce132b1…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Dec 5 11:11:59 2011 +0100 jscript: Use bytecode for assignment to member expression. --- dlls/jscript/compile.c | 16 ++++++++++++++++ dlls/jscript/engine.c | 5 ++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/dlls/jscript/compile.c b/dlls/jscript/compile.c index a237093..93d780f 100644 --- a/dlls/jscript/compile.c +++ b/dlls/jscript/compile.c @@ -373,6 +373,22 @@ static HRESULT compile_assign_expression(compiler_ctx_t *ctx, binary_expression_ return E_OUTOFMEMORY; break; } + case EXPR_MEMBER: { + member_expression_t *member_expr = (member_expression_t*)expr->expression1; + + hres = compile_expression(ctx, member_expr->expression); + if(FAILED(hres)) + return hres; + + /* FIXME: Potential optimization */ + hres = push_instr_str(ctx, OP_str, member_expr->identifier); + if(FAILED(hres)) + return hres; + + if(push_instr(ctx, OP_memberid) == -1) + return E_OUTOFMEMORY; + break; + } default: expr->expr.eval = assign_expression_eval; return compile_interp_fallback(ctx, &expr->expr); diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c index e4d918f..2af2d75 100644 --- a/dlls/jscript/engine.c +++ b/dlls/jscript/engine.c @@ -3328,9 +3328,8 @@ HRESULT assign_expression_eval(script_ctx_t *ctx, expression_t *_expr, DWORD fla } if(SUCCEEDED(hres)) { - hres = put_value(ctx, &exprval, &rval, ei); - if(FAILED(hres)) - VariantClear(&rval); + assert(exprval.type != EXPRVAL_IDREF); + return throw_reference_error(ctx, ei, JS_E_ILLEGAL_ASSIGN, NULL); } exprval_release(&exprval);
1
0
0
0
Jacek Caban : jscript: Use bytecode for assigning to array expression.
by Alexandre Julliard
05 Dec '11
05 Dec '11
Module: wine Branch: master Commit: 9aafd0311086a22fde37119fe1a28e6c2b9b9bf5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9aafd0311086a22fde37119fe…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Dec 5 11:11:45 2011 +0100 jscript: Use bytecode for assigning to array expression. --- dlls/jscript/compile.c | 15 +++++++++++++++ dlls/jscript/engine.c | 35 +++++++++++++++++++++++++++++++++++ dlls/jscript/engine.h | 1 + 3 files changed, 51 insertions(+), 0 deletions(-) diff --git a/dlls/jscript/compile.c b/dlls/jscript/compile.c index 3679dfe..a237093 100644 --- a/dlls/jscript/compile.c +++ b/dlls/jscript/compile.c @@ -358,6 +358,21 @@ static HRESULT compile_assign_expression(compiler_ctx_t *ctx, binary_expression_ return hres; break; } + case EXPR_ARRAY: { + array_expression_t *array_expr = (array_expression_t*)expr->expression1; + + hres = compile_expression(ctx, array_expr->member_expr); + if(FAILED(hres)) + return hres; + + hres = compile_expression(ctx, array_expr->expression); + if(FAILED(hres)) + return hres; + + if(push_instr(ctx, OP_memberid) == -1) + return E_OUTOFMEMORY; + break; + } default: expr->expr.eval = assign_expression_eval; return compile_interp_fallback(ctx, &expr->expr); diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c index c445eab..e4d918f 100644 --- a/dlls/jscript/engine.c +++ b/dlls/jscript/engine.c @@ -1573,6 +1573,41 @@ HRESULT member_expression_eval(script_ctx_t *ctx, expression_t *_expr, DWORD fla return hres; } +/* ECMA-262 3rd Edition 11.2.1 */ +static HRESULT interp_memberid(exec_ctx_t *ctx) +{ + VARIANT *objv, *namev; + IDispatch *obj; + BSTR name; + DISPID id; + HRESULT hres; + + TRACE("\n"); + + namev = stack_pop(ctx); + objv = stack_pop(ctx); + + hres = to_object(ctx->parser->script, objv, &obj); + VariantClear(objv); + if(SUCCEEDED(hres)) { + hres = to_string(ctx->parser->script, namev, &ctx->ei, &name); + if(FAILED(hres)) + IDispatch_Release(obj); + } + VariantClear(namev); + if(FAILED(hres)) + return hres; + + hres = disp_get_id(ctx->parser->script, obj, name, fdexNameEnsure, &id); + SysFreeString(name); + if(FAILED(hres)) { + IDispatch_Release(obj); + return hres; + } + + return stack_push_objid(ctx, obj, id); +} + static void free_dp(DISPPARAMS *dp) { DWORD i; diff --git a/dlls/jscript/engine.h b/dlls/jscript/engine.h index 12329e8..a032f7b 100644 --- a/dlls/jscript/engine.h +++ b/dlls/jscript/engine.h @@ -62,6 +62,7 @@ typedef struct _func_stack { X(jmp_z, 0, ARG_ADDR, 0) \ X(lt, 1, 0,0) \ X(lteq, 1, 0,0) \ + X(memberid, 1, 0,0) \ X(minus, 1, 0,0) \ X(mod, 1, 0,0) \ X(mul, 1, 0,0) \
1
0
0
0
Jacek Caban : jscript: Use bytecode for assignment to identifier.
by Alexandre Julliard
05 Dec '11
05 Dec '11
Module: wine Branch: master Commit: d3d2f063b617d3c979bc62c0a6edbcd3b944d344 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d3d2f063b617d3c979bc62c0a…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Dec 5 11:11:29 2011 +0100 jscript: Use bytecode for assignment to identifier. --- dlls/jscript/compile.c | 35 ++++++++++++++++++++- dlls/jscript/engine.c | 72 ++++++++++++++++++++++++++++++++++++++++++++ dlls/jscript/engine.h | 4 ++- dlls/jscript/parser.y | 2 +- dlls/jscript/tests/api.js | 4 ++ dlls/jscript/tests/lang.js | 3 ++ 6 files changed, 116 insertions(+), 4 deletions(-) diff --git a/dlls/jscript/compile.c b/dlls/jscript/compile.c index ed42b4d..3679dfe 100644 --- a/dlls/jscript/compile.c +++ b/dlls/jscript/compile.c @@ -345,6 +345,35 @@ static HRESULT compile_delete_expression(compiler_ctx_t *ctx, unary_expression_t return S_OK; } +static HRESULT compile_assign_expression(compiler_ctx_t *ctx, binary_expression_t *expr) +{ + HRESULT hres; + + switch(expr->expression1->type) { + case EXPR_IDENT: { + identifier_expression_t *ident_expr = (identifier_expression_t*)expr->expression1; + + hres = push_instr_bstr(ctx, OP_identid, ident_expr->identifier); + if(FAILED(hres)) + return hres; + break; + } + default: + expr->expr.eval = assign_expression_eval; + return compile_interp_fallback(ctx, &expr->expr); + } + + + hres = compile_expression(ctx, expr->expression2); + if(FAILED(hres)) + return hres; + + if(push_instr(ctx, OP_assign) == -1) + return E_OUTOFMEMORY; + + return S_OK; +} + static HRESULT compile_literal(compiler_ctx_t *ctx, literal_t *literal) { switch(literal->type) { @@ -384,10 +413,12 @@ static HRESULT compile_literal(compiler_ctx_t *ctx, literal_t *literal) static HRESULT compile_expression(compiler_ctx_t *ctx, expression_t *expr) { switch(expr->type) { - case EXPR_AND: - return compile_logical_expression(ctx, (binary_expression_t*)expr, OP_jmp_z); case EXPR_ADD: return compile_binary_expression(ctx, (binary_expression_t*)expr, OP_add); + case EXPR_AND: + return compile_logical_expression(ctx, (binary_expression_t*)expr, OP_jmp_z); + case EXPR_ASSIGN: + return compile_assign_expression(ctx, (binary_expression_t*)expr); case EXPR_BITNEG: return compile_unary_expression(ctx, (unary_expression_t*)expr, OP_bneg); case EXPR_BOR: diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c index d24392c..c445eab 100644 --- a/dlls/jscript/engine.c +++ b/dlls/jscript/engine.c @@ -102,6 +102,22 @@ static inline HRESULT stack_push_int(exec_ctx_t *ctx, INT n) return stack_push(ctx, &v); } +static HRESULT stack_push_objid(exec_ctx_t *ctx, IDispatch *disp, DISPID id) +{ + VARIANT v; + HRESULT hres; + + V_VT(&v) = VT_DISPATCH; + V_DISPATCH(&v) = disp; + hres = stack_push(ctx, &v); + if(FAILED(hres)) + return hres; + + V_VT(&v) = VT_INT; + V_INT(&v) = id; + return stack_push(ctx, &v); +} + static inline VARIANT *stack_top(exec_ctx_t *ctx) { assert(ctx->top); @@ -142,6 +158,14 @@ static inline HRESULT stack_pop_int(exec_ctx_t *ctx, INT *r) return to_int32(ctx->parser->script, stack_pop(ctx), &ctx->ei, r); } +static inline IDispatch *stack_pop_objid(exec_ctx_t *ctx, DISPID *id) +{ + assert(V_VT(stack_top(ctx)) == VT_INT && V_VT(stack_topn(ctx, 1)) == VT_DISPATCH); + + *id = V_INT(stack_pop(ctx)); + return V_DISPATCH(stack_pop(ctx)); +} + static void exprval_release(exprval_t *val) { switch(val->type) { @@ -1757,6 +1781,28 @@ static HRESULT interp_ident(exec_ctx_t *ctx) return stack_push(ctx, &v); } +/* ECMA-262 3rd Edition 10.1.4 */ +static HRESULT interp_identid(exec_ctx_t *ctx) +{ + const BSTR arg = ctx->parser->code->instrs[ctx->ip].arg1.bstr; + exprval_t exprval; + HRESULT hres; + + TRACE("%s\n", debugstr_w(arg)); + + hres = identifier_eval(ctx->parser->script, arg, EXPR_NEWREF, &ctx->ei, &exprval); + if(FAILED(hres)) + return hres; + + if(exprval.type != EXPRVAL_IDREF) { + WARN("invalid ref\n"); + exprval_release(&exprval); + return stack_push_objid(ctx, NULL, -1); + } + + return stack_push_objid(ctx, exprval.u.idref.disp, exprval.u.idref.id); +} + /* ECMA-262 3rd Edition 7.8.1 */ static HRESULT interp_null(exec_ctx_t *ctx) { @@ -3261,6 +3307,32 @@ HRESULT assign_expression_eval(script_ctx_t *ctx, expression_t *_expr, DWORD fla return S_OK; } +/* ECMA-262 3rd Edition 11.13.1 */ +static HRESULT interp_assign(exec_ctx_t *ctx) +{ + IDispatch *disp; + DISPID id; + VARIANT *v; + HRESULT hres; + + TRACE("\n"); + + v = stack_pop(ctx); + disp = stack_pop_objid(ctx, &id); + + if(!disp) + return throw_reference_error(ctx->parser->script, &ctx->ei, JS_E_ILLEGAL_ASSIGN, NULL); + + hres = disp_propput(ctx->parser->script, disp, id, v, &ctx->ei, NULL/*FIXME*/); + IDispatch_Release(disp); + if(FAILED(hres)) { + VariantClear(v); + return hres; + } + + return stack_push(ctx, v); +} + /* ECMA-262 3rd Edition 11.13.2 */ HRESULT assign_lshift_expression_eval(script_ctx_t *ctx, expression_t *_expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) { diff --git a/dlls/jscript/engine.h b/dlls/jscript/engine.h index e86db0f..12329e8 100644 --- a/dlls/jscript/engine.h +++ b/dlls/jscript/engine.h @@ -43,6 +43,7 @@ typedef struct _func_stack { #define OP_LIST \ X(add, 1, 0,0) \ + X(assign, 1, 0,0) \ X(bool, 1, ARG_INT, 0) \ X(bneg, 1, 0,0) \ X(delete, 1, 0,0) \ @@ -51,8 +52,9 @@ typedef struct _func_stack { X(eq, 1, 0,0) \ X(eq2, 1, 0,0) \ X(gt, 1, 0,0) \ - X(gteq, 1, 0,0) \ + X(gteq, 1, 0,0) \ X(ident, 1, ARG_BSTR, 0) \ + X(identid, 1, ARG_BSTR, 0) \ X(in, 1, 0,0) \ X(int, 1, ARG_INT, 0) \ X(jmp, 0, ARG_ADDR, 0) \ diff --git a/dlls/jscript/parser.y b/dlls/jscript/parser.y index c1c5df6..55f8aac 100644 --- a/dlls/jscript/parser.y +++ b/dlls/jscript/parser.y @@ -1340,7 +1340,7 @@ static const expression_eval_t expression_eval_table[] = { left_shift_expression_eval, right_shift_expression_eval, right2_shift_expression_eval, - assign_expression_eval, + compiled_expression_eval, assign_lshift_expression_eval, assign_rshift_expression_eval, assign_rrshift_expression_eval, diff --git a/dlls/jscript/tests/api.js b/dlls/jscript/tests/api.js index d99364f..b5ac66a 100644 --- a/dlls/jscript/tests/api.js +++ b/dlls/jscript/tests/api.js @@ -2072,6 +2072,10 @@ testSyntaxError("/* @cc_on @*/ @_jscript_version", "E_DISABLED_CC"); // ReferenceError tests testException(function() {test = function() {}}, "E_ILLEGAL_ASSIGN"); +tmp = false; +testException(function() {test = (tmp = true);}, "E_ILLEGAL_ASSIGN"); +ok(tmp, "expr value on invalid assign not evaluated"); + // RegExpError tests testException(function() {RegExp(/a/, "g");}, "E_REGEXP_SYNTAX_ERROR"); diff --git a/dlls/jscript/tests/lang.js b/dlls/jscript/tests/lang.js index 4f3d509..1dd0c02 100644 --- a/dlls/jscript/tests/lang.js +++ b/dlls/jscript/tests/lang.js @@ -118,6 +118,9 @@ ok(testFunc1(true, "test") === true, "testFunc1 not returned true"); ok(testFunc1.arguments === null, "testFunc1.arguments = " + testFunc1.arguments); +(tmp) = 3; +ok(tmp === 3, "tmp = " + tmp); + function testRecFunc(x) { ok(testRecFunc.arguments === arguments, "testRecFunc.arguments = " + testRecFunc.arguments); if(x) {
1
0
0
0
Andrew Eikum : dsound: Validate format in primary buffer's SetFormat().
by Alexandre Julliard
05 Dec '11
05 Dec '11
Module: wine Branch: master Commit: 287a6e8473cb40396b00556ced4f9b275f54ff8e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=287a6e8473cb40396b00556ce…
Author: Andrew Eikum <aeikum(a)codeweavers.com> Date: Fri Dec 2 11:53:14 2011 -0600 dsound: Validate format in primary buffer's SetFormat(). --- dlls/dsound/primary.c | 6 ++ dlls/dsound/tests/dsound.c | 139 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 145 insertions(+), 0 deletions(-) diff --git a/dlls/dsound/primary.c b/dlls/dsound/primary.c index 3b61562..1cc59e5 100644 --- a/dlls/dsound/primary.c +++ b/dlls/dsound/primary.c @@ -374,6 +374,12 @@ HRESULT primarybuffer_SetFormat(DirectSoundDevice *device, LPCWAVEFORMATEX passe passed_fmt->nAvgBytesPerSec, passed_fmt->nBlockAlign, passed_fmt->wBitsPerSample, passed_fmt->cbSize); + if(passed_fmt->wBitsPerSample < 8 || passed_fmt->wBitsPerSample % 8 != 0 || + passed_fmt->nChannels == 0 || passed_fmt->nSamplesPerSec == 0 || + passed_fmt->nAvgBytesPerSec == 0 || + passed_fmt->nBlockAlign != passed_fmt->nChannels * passed_fmt->wBitsPerSample / 8) + return DSERR_INVALIDPARAM; + /* **** */ RtlAcquireResourceExclusive(&(device->buffer_list_lock), TRUE); EnterCriticalSection(&(device->mixlock)); diff --git a/dlls/dsound/tests/dsound.c b/dlls/dsound/tests/dsound.c index 0c0239c..45dd00a 100644 --- a/dlls/dsound/tests/dsound.c +++ b/dlls/dsound/tests/dsound.c @@ -1221,6 +1221,144 @@ EXIT: return rc; } +static HRESULT test_invalid_fmts(LPGUID lpGuid) +{ + HRESULT rc; + LPDIRECTSOUND dso=NULL; + LPDIRECTSOUNDBUFFER primary=NULL; + DSBUFFERDESC bufdesc; + + /* Create the DirectSound object */ + rc=pDirectSoundCreate(lpGuid,&dso,NULL); + ok(rc==DS_OK||rc==DSERR_NODRIVER||rc==DSERR_ALLOCATED, + "DirectSoundCreate() failed: %08x\n",rc); + if (rc!=DS_OK) + return rc; + + /* We must call SetCooperativeLevel before creating primary buffer */ + /* DSOUND: Setting DirectSound cooperative level to DSSCL_PRIORITY */ + rc=IDirectSound_SetCooperativeLevel(dso,get_hwnd(),DSSCL_PRIORITY); + ok(rc==DS_OK,"IDirectSound_SetCooperativeLevel() failed: %08x\n", rc); + if (rc!=DS_OK){ + IDirectSound_Release(dso); + return rc; + } + + ZeroMemory(&bufdesc, sizeof(bufdesc)); + bufdesc.dwSize=sizeof(bufdesc); + bufdesc.dwFlags=DSBCAPS_PRIMARYBUFFER; + rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&primary,NULL); + ok(rc==DS_OK && primary!=NULL,"IDirectSound_CreateSoundBuffer() failed " + "to create a primary buffer %08x\n",rc); + + if (rc==DS_OK && primary!=NULL) { + WAVEFORMATEX wfx; + + wfx.wFormatTag = WAVE_FORMAT_PCM; + wfx.nChannels = 0; + wfx.nSamplesPerSec = 44100; + wfx.wBitsPerSample = 16; + wfx.nBlockAlign = wfx.nChannels * wfx.wBitsPerSample / 8; + wfx.nAvgBytesPerSec = wfx.nSamplesPerSec * wfx.nBlockAlign; + rc = IDirectSoundBuffer_SetFormat(primary, &wfx); + ok(rc == E_INVALIDARG, "SetFormat: %08x\n", rc); + + wfx.nChannels = 2; + wfx.nSamplesPerSec = 44100; + wfx.wBitsPerSample = 0; + wfx.nBlockAlign = wfx.nChannels * wfx.wBitsPerSample / 8; + wfx.nAvgBytesPerSec = wfx.nSamplesPerSec * wfx.nBlockAlign; + rc = IDirectSoundBuffer_SetFormat(primary, &wfx); + ok(rc == E_INVALIDARG, "SetFormat: %08x\n", rc); + + wfx.nChannels = 2; + wfx.nSamplesPerSec = 44100; + wfx.wBitsPerSample = 2; + wfx.nBlockAlign = wfx.nChannels * wfx.wBitsPerSample / 8; + wfx.nAvgBytesPerSec = wfx.nSamplesPerSec * wfx.nBlockAlign; + rc = IDirectSoundBuffer_SetFormat(primary, &wfx); + ok(rc == E_INVALIDARG, "SetFormat: %08x\n", rc); + + wfx.nChannels = 2; + wfx.nSamplesPerSec = 44100; + wfx.wBitsPerSample = 12; + wfx.nBlockAlign = wfx.nChannels * wfx.wBitsPerSample / 8; + wfx.nAvgBytesPerSec = wfx.nSamplesPerSec * wfx.nBlockAlign; + rc = IDirectSoundBuffer_SetFormat(primary, &wfx); + ok(rc == E_INVALIDARG, "SetFormat: %08x\n", rc); + + wfx.nChannels = 2; + wfx.nSamplesPerSec = 0; + wfx.wBitsPerSample = 16; + wfx.nBlockAlign = wfx.nChannels * wfx.wBitsPerSample / 8; + wfx.nAvgBytesPerSec = wfx.nSamplesPerSec * wfx.nBlockAlign; + rc = IDirectSoundBuffer_SetFormat(primary, &wfx); + ok(rc == E_INVALIDARG, "SetFormat: %08x\n", rc); + + wfx.nChannels = 2; + wfx.nSamplesPerSec = 44100; + wfx.wBitsPerSample = 16; + wfx.nBlockAlign = 0; + wfx.nAvgBytesPerSec = wfx.nSamplesPerSec * wfx.nBlockAlign; + rc = IDirectSoundBuffer_SetFormat(primary, &wfx); + ok(rc == E_INVALIDARG, "SetFormat: %08x\n", rc); + + wfx.nChannels = 2; + wfx.nSamplesPerSec = 44100; + wfx.wBitsPerSample = 16; + wfx.nBlockAlign = wfx.nChannels * wfx.wBitsPerSample / 8; + wfx.nAvgBytesPerSec = 0; + rc = IDirectSoundBuffer_SetFormat(primary, &wfx); + ok(rc == E_INVALIDARG, "SetFormat: %08x\n", rc); + + wfx.nChannels = 2; + wfx.nSamplesPerSec = 44100; + wfx.wBitsPerSample = 16; + wfx.nBlockAlign = (wfx.nChannels * wfx.wBitsPerSample / 8) - 1; + wfx.nAvgBytesPerSec = wfx.nSamplesPerSec * wfx.nBlockAlign; + rc = IDirectSoundBuffer_SetFormat(primary, &wfx); + ok(rc == E_INVALIDARG, "SetFormat: %08x\n", rc); + + wfx.nChannels = 2; + wfx.nSamplesPerSec = 44100; + wfx.wBitsPerSample = 16; + wfx.nBlockAlign = (wfx.nChannels * wfx.wBitsPerSample / 8) + 1; + wfx.nAvgBytesPerSec = wfx.nSamplesPerSec * wfx.nBlockAlign; + rc = IDirectSoundBuffer_SetFormat(primary, &wfx); + ok(rc == E_INVALIDARG, "SetFormat: %08x\n", rc); + + wfx.nChannels = 2; + wfx.nSamplesPerSec = 44100; + wfx.wBitsPerSample = 16; + wfx.nBlockAlign = wfx.nChannels * wfx.wBitsPerSample / 8; + wfx.nAvgBytesPerSec = wfx.nSamplesPerSec * wfx.nBlockAlign + 1; + rc = IDirectSoundBuffer_SetFormat(primary, &wfx); + ok(rc == S_OK, "SetFormat: %08x\n", rc); + + wfx.nChannels = 2; + wfx.nSamplesPerSec = 44100; + wfx.wBitsPerSample = 16; + wfx.nBlockAlign = wfx.nChannels * wfx.wBitsPerSample / 8; + wfx.nAvgBytesPerSec = wfx.nSamplesPerSec * wfx.nBlockAlign - 1; + rc = IDirectSoundBuffer_SetFormat(primary, &wfx); + ok(rc == S_OK, "SetFormat: %08x\n", rc); + + wfx.nChannels = 2; + wfx.nSamplesPerSec = 44100; + wfx.wBitsPerSample = 16; + wfx.nBlockAlign = wfx.nChannels * wfx.wBitsPerSample / 8; + wfx.nAvgBytesPerSec = wfx.nSamplesPerSec * wfx.nBlockAlign + 1; + rc = IDirectSoundBuffer_SetFormat(primary, &wfx); + ok(rc == S_OK, "SetFormat: %08x\n", rc); + + IDirectSoundBuffer_Release(primary); + } + + IDirectSound_Release(dso); + + return S_OK; +} + static unsigned int number; static BOOL WINAPI dsenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription, @@ -1250,6 +1388,7 @@ static BOOL WINAPI dsenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription, test_secondary(lpGuid); test_frequency(lpGuid); test_duplicate(lpGuid); + test_invalid_fmts(lpGuid); } return 1;
1
0
0
0
Nikolay Sivov : comctl32/listview: Create header when LVS_EX_GRIDLINES style is set.
by Alexandre Julliard
05 Dec '11
05 Dec '11
Module: wine Branch: master Commit: dfbe664548294cf76ca401b89dbf5cd6bbfe0308 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=dfbe664548294cf76ca401b89…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Sun Dec 4 21:18:57 2011 +0300 comctl32/listview: Create header when LVS_EX_GRIDLINES style is set. --- dlls/comctl32/listview.c | 39 +++++++++++++++++++++------------------ dlls/comctl32/tests/listview.c | 14 ++++++++++++++ 2 files changed, 35 insertions(+), 18 deletions(-) diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index b0c4646..c951633 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -8392,17 +8392,19 @@ static HIMAGELIST LISTVIEW_CreateCheckBoxIL(const LISTVIEW_INFO *infoPtr) * SUCCESS : previous style * FAILURE : 0 */ -static DWORD LISTVIEW_SetExtendedListViewStyle(LISTVIEW_INFO *infoPtr, DWORD dwMask, DWORD dwExStyle) +static DWORD LISTVIEW_SetExtendedListViewStyle(LISTVIEW_INFO *infoPtr, DWORD mask, DWORD ex_style) { - DWORD dwOldExStyle = infoPtr->dwLvExStyle; + DWORD old_ex_style = infoPtr->dwLvExStyle; + + TRACE("mask=0x%08x, ex_style=0x%08x\n", mask, ex_style); /* set new style */ - if (dwMask) - infoPtr->dwLvExStyle = (dwOldExStyle & ~dwMask) | (dwExStyle & dwMask); + if (mask) + infoPtr->dwLvExStyle = (old_ex_style & ~mask) | (ex_style & mask); else - infoPtr->dwLvExStyle = dwExStyle; + infoPtr->dwLvExStyle = ex_style; - if((infoPtr->dwLvExStyle ^ dwOldExStyle) & LVS_EX_CHECKBOXES) + if((infoPtr->dwLvExStyle ^ old_ex_style) & LVS_EX_CHECKBOXES) { HIMAGELIST himl = 0; if(infoPtr->dwLvExStyle & LVS_EX_CHECKBOXES) @@ -8422,38 +8424,39 @@ static DWORD LISTVIEW_SetExtendedListViewStyle(LISTVIEW_INFO *infoPtr, DWORD dwM if(((infoPtr->dwLvExStyle & LVS_EX_CHECKBOXES) && !(infoPtr->dwStyle & LVS_SHAREIMAGELISTS)) || /* ...previous was checkbox list */ - (dwOldExStyle & LVS_EX_CHECKBOXES)) + (old_ex_style & LVS_EX_CHECKBOXES)) ImageList_Destroy(himl); } - if((infoPtr->dwLvExStyle ^ dwOldExStyle) & LVS_EX_HEADERDRAGDROP) + if((infoPtr->dwLvExStyle ^ old_ex_style) & LVS_EX_HEADERDRAGDROP) { - DWORD dwStyle; + DWORD style; /* if not already created */ LISTVIEW_CreateHeader(infoPtr); - dwStyle = GetWindowLongW(infoPtr->hwndHeader, GWL_STYLE); + style = GetWindowLongW(infoPtr->hwndHeader, GWL_STYLE); if (infoPtr->dwLvExStyle & LVS_EX_HEADERDRAGDROP) - dwStyle |= HDS_DRAGDROP; + style |= HDS_DRAGDROP; else - dwStyle &= ~HDS_DRAGDROP; - SetWindowLongW(infoPtr->hwndHeader, GWL_STYLE, dwStyle); + style &= ~HDS_DRAGDROP; + SetWindowLongW(infoPtr->hwndHeader, GWL_STYLE, style); } /* GRIDLINES adds decoration at top so changes sizes */ - if((infoPtr->dwLvExStyle ^ dwOldExStyle) & LVS_EX_GRIDLINES) + if((infoPtr->dwLvExStyle ^ old_ex_style) & LVS_EX_GRIDLINES) { + LISTVIEW_CreateHeader(infoPtr); LISTVIEW_UpdateSize(infoPtr); } - if((infoPtr->dwLvExStyle ^ dwOldExStyle) & LVS_EX_TRANSPARENTBKGND) + if((infoPtr->dwLvExStyle ^ old_ex_style) & LVS_EX_TRANSPARENTBKGND) { if (infoPtr->dwLvExStyle & LVS_EX_TRANSPARENTBKGND) LISTVIEW_SetBkColor(infoPtr, CLR_NONE); } - if((infoPtr->dwLvExStyle ^ dwOldExStyle) & LVS_EX_HEADERINALLVIEWS) + if((infoPtr->dwLvExStyle ^ old_ex_style) & LVS_EX_HEADERINALLVIEWS) { if (infoPtr->dwLvExStyle & LVS_EX_HEADERINALLVIEWS) LISTVIEW_CreateHeader(infoPtr); @@ -8464,7 +8467,7 @@ static DWORD LISTVIEW_SetExtendedListViewStyle(LISTVIEW_INFO *infoPtr, DWORD dwM } LISTVIEW_InvalidateList(infoPtr); - return dwOldExStyle; + return old_ex_style; } /*** @@ -9369,7 +9372,7 @@ static LRESULT LISTVIEW_Create(HWND hwnd, const CREATESTRUCTW *lpcs) { LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)GetWindowLongPtrW(hwnd, 0); - TRACE("(lpcs=%p)\n", lpcs); + TRACE("(lpcs=%p, style=0x%08x)\n", lpcs, lpcs->style); infoPtr->dwStyle = lpcs->style; map_style_view(infoPtr); diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c index 344df1d..64d6090 100644 --- a/dlls/comctl32/tests/listview.c +++ b/dlls/comctl32/tests/listview.c @@ -1543,6 +1543,20 @@ static void test_create(void) ok(hHeader == GetDlgItem(hList, 0), "Expected header as dialog item\n"); DestroyWindow(hList); + /* setting LVS_EX_GRIDLINES creates header */ + hList = CreateWindow("SysListView32", "Test", LVS_REPORT, 0, 0, 100, 100, NULL, NULL, + GetModuleHandle(NULL), 0); + hHeader = (HWND)SendMessage(hList, LVM_GETHEADER, 0, 0); + ok(!IsWindow(hHeader), "Header shouldn't be created\n"); + ok(NULL == GetDlgItem(hList, 0), "NULL dialog item expected\n"); + SendMessage(hList, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_GRIDLINES); + hHeader = (HWND)SendMessage(hList, LVM_GETHEADER, 0, 0); + ok(IsWindow(hHeader) || + broken(!IsWindow(hHeader)), /* 4.7x common controls */ + "Header should be created\n"); + ok(hHeader == GetDlgItem(hList, 0), "Expected header as dialog item\n"); + DestroyWindow(hList); + /* not report style accepts LVS_EX_HEADERDRAGDROP too */ hList = create_listview_control(LVS_ICON); SendMessage(hList, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_HEADERDRAGDROP);
1
0
0
0
Henri Verbeet : wined3d: Get rid of WINED3DDEVINFO_VCACHE.
by Alexandre Julliard
05 Dec '11
05 Dec '11
Module: wine Branch: master Commit: 6a6e11084914e5ad7d3128e74cb1c8af9c4533c0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6a6e11084914e5ad7d3128e74…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Sun Dec 4 15:50:16 2011 +0100 wined3d: Get rid of WINED3DDEVINFO_VCACHE. --- include/wine/wined3d.h | 10 ---------- 1 files changed, 0 insertions(+), 10 deletions(-) diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 2704152..f4f9578 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -1725,16 +1725,6 @@ typedef struct _WINED3DBOX UINT Back; } WINED3DBOX; -/*Vertex cache optimization hints.*/ -typedef struct WINED3DDEVINFO_VCACHE -{ - DWORD Pattern; /* Must be a 4 char code FOURCC (e.g. CACH) */ - DWORD OptMethod; /* 0 to get the longest strips, 1 vertex cache */ - DWORD CacheSize; /* Cache size to use (only valid if OptMethod==1) */ - DWORD MagicNumber; /* Internal for deciding when to restart strips, - non user modifiable (only valid if OptMethod==1) */ -} WINED3DDEVINFO_VCACHE; - typedef struct WineDirect3DStridedData { enum wined3d_format_id format; /* Format of the data */
1
0
0
0
Henri Verbeet : wined3d: Get rid of WINED3DDEVINFO_VERTEXSTATS.
by Alexandre Julliard
05 Dec '11
05 Dec '11
Module: wine Branch: master Commit: 529286bdcdbe5f858360c6778901a9600267b294 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=529286bdcdbe5f858360c6778…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Sun Dec 4 15:50:15 2011 +0100 wined3d: Get rid of WINED3DDEVINFO_VERTEXSTATS. --- include/wine/wined3d.h | 6 ------ 1 files changed, 0 insertions(+), 6 deletions(-) diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 1a0d170..2704152 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -1702,12 +1702,6 @@ struct wined3d_raster_status UINT scan_line; }; -typedef struct _WINED3DDEVINFO_VERTEXSTATS -{ - DWORD NumRenderedTriangles; - DWORD NumExtraClippingTriangles; -} WINED3DDEVINFO_VERTEXSTATS; - typedef struct _WINED3DLOCKED_RECT { INT Pitch;
1
0
0
0
Henri Verbeet : wined3d: Only unload the surface when we' re using GL for rendering in updateSurfaceDesc().
by Alexandre Julliard
05 Dec '11
05 Dec '11
Module: wine Branch: master Commit: c43aa1ada82e30168a373d584ad7ef62a5e04677 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c43aa1ada82e30168a373d584…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Sun Dec 4 15:50:14 2011 +0100 wined3d: Only unload the surface when we're using GL for rendering in updateSurfaceDesc(). --- dlls/wined3d/device.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 515ff06..5b48d77 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -5230,7 +5230,8 @@ static HRESULT updateSurfaceDesc(struct wined3d_surface *surface, surface->resource.multisample_type = swapchain_desc->multisample_type; surface->resource.multisample_quality = swapchain_desc->multisample_quality; - surface->resource.resource_ops->resource_unload(&surface->resource); + if (device->d3d_initialized) + surface->resource.resource_ops->resource_unload(&surface->resource); if (surface->pow2Width != swapchain_desc->backbuffer_width || surface->pow2Height != swapchain_desc->backbuffer_height)
1
0
0
0
Henri Verbeet : wined3d: Only recreate GL contexts when we' re using GL for rendering in wined3d_device_reset().
by Alexandre Julliard
05 Dec '11
05 Dec '11
Module: wine Branch: master Commit: 31bf03d8a1434b1f7d5421295b8fc216153ef0ce URL:
http://source.winehq.org/git/wine.git/?a=commit;h=31bf03d8a1434b1f7d5421295…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Sun Dec 4 15:50:13 2011 +0100 wined3d: Only recreate GL contexts when we're using GL for rendering in wined3d_device_reset(). --- dlls/wined3d/device.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index e96e3c4..515ff06 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -5604,7 +5604,8 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, } } - delete_opengl_contexts(device, swapchain); + if (device->d3d_initialized) + delete_opengl_contexts(device, swapchain); if (!swapchain_desc->windowed != !swapchain->desc.windowed || DisplayModeChanged) @@ -5678,7 +5679,8 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, swapchain_update_render_to_fbo(swapchain); swapchain_update_draw_bindings(swapchain); - hr = create_primary_opengl_context(device, swapchain); + if (device->d3d_initialized) + hr = create_primary_opengl_context(device, swapchain); wined3d_swapchain_decref(swapchain); /* All done. There is no need to reload resources or shaders, this will happen automatically on the
1
0
0
0
← Newer
1
...
70
71
72
73
74
75
76
...
81
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
Results per page:
10
25
50
100
200