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
May 2017
----- 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
640 discussions
Start a n
N
ew thread
Rosanne DiMesio : Fix Manage Notes page layout
by Jeremy Newman
02 May '17
02 May '17
Module: appdb Branch: master Commit: 91642742e92a3e8d1697a9e49d498d2ef051417c URL:
http://source.winehq.org/git/appdb.git/?a=commit;h=91642742e92a3e8d1697a9e4…
Author: Rosanne DiMesio <dimesio(a)earthlink.net> Date: Tue May 2 13:05:05 2017 -0500 Fix Manage Notes page layout Fixes bug 42115. Signed-off-by: Rosanne DiMesio <dimesio(a)earthlink.net> Signed-off-by: Jeremy Newman <jnewman(a)codeweavers.com> --- include/tagAssignmentMgr.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/include/tagAssignmentMgr.php b/include/tagAssignmentMgr.php index 28c1566..37ddb7f 100644 --- a/include/tagAssignmentMgr.php +++ b/include/tagAssignmentMgr.php @@ -62,7 +62,6 @@ abstract class TagAssignmentMgr extends ObjectManagerBase $iSize = min(sizeof($this->aTaggedEntries), 10); - echo '<div style="float: left;">'; $i = 0; $shOptions = ''; @@ -74,8 +73,8 @@ abstract class TagAssignmentMgr extends ObjectManagerBase } echo "<select size=\"$iSize\" name=\"iTagAssocList\">\n"; echo $shOptions; - echo '</select></div>'; - echo '<div style="margin-left: 10px; float: left;">'; + echo '</select>'; + echo '<div style="padding-bottom: 10px;">'; echo "<script type=\"text/JavaScript\">\n"; echo "function swap(index1, index2) {\n"; echo "var selector = document.forms['sQform']['iTagAssocList'];\n"; @@ -104,8 +103,10 @@ abstract class TagAssignmentMgr extends ObjectManagerBase echo "swap(index, index + 1);\n"; echo "}\n"; echo "</script>\n"; - echo '<button onclick="moveUp()" type="button">Move up</button><br />'; - echo '<button onclick="moveDown()" type="button">Move down</button>'; + echo '</div>'; + echo '<div class="btn-toolbar";>'; + echo '<button onclick="moveUp()" type="button" class="btn btn-default">Move up</button>'; + echo '<button onclick="moveDown()" type="button" class="btn btn-default">Move down</button>'; echo '</div>'; } @@ -140,4 +141,4 @@ abstract class TagAssignmentMgr extends ObjectManagerBase protected abstract function getTagObject($iId = null, $oRow = null); } -?> \ No newline at end of file +?>
1
0
0
0
Michael Stefaniuc : dmusic: Implement IDirectMusicBuffer::PackUnstructured ().
by Alexandre Julliard
01 May '17
01 May '17
Module: wine Branch: master Commit: 7cd7f14696dc3fb7aa41ef253ad144d458304a28 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7cd7f14696dc3fb7aa41ef253…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Mon May 1 18:51:30 2017 +0200 dmusic: Implement IDirectMusicBuffer::PackUnstructured(). Based on a patch by Michael Müller <michael(a)fds-team.de>. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dmusic/buffer.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/dlls/dmusic/buffer.c b/dlls/dmusic/buffer.c index eecacbb..dbc8058 100644 --- a/dlls/dmusic/buffer.c +++ b/dlls/dmusic/buffer.c @@ -131,11 +131,29 @@ static HRESULT WINAPI IDirectMusicBufferImpl_PackStructured(LPDIRECTMUSICBUFFER return S_OK; } -static HRESULT WINAPI IDirectMusicBufferImpl_PackUnstructured(LPDIRECTMUSICBUFFER iface, REFERENCE_TIME rt, DWORD dwChannelGroup, DWORD cb, LPBYTE lpb) +static HRESULT WINAPI IDirectMusicBufferImpl_PackUnstructured(IDirectMusicBuffer *iface, + REFERENCE_TIME ref_time, DWORD channel_group, DWORD len, BYTE *data) { IDirectMusicBufferImpl *This = impl_from_IDirectMusicBuffer(iface); + DWORD new_write_pos = This->write_pos + DMUS_EVENT_SIZE(len); + DMUS_EVENTHEADER *header; - FIXME("(%p, 0x%s, %d, %d, %p): stub\n", This, wine_dbgstr_longlong(rt), dwChannelGroup, cb, lpb); + TRACE("(%p, 0x%s, %d, %d, %p)\n", This, wine_dbgstr_longlong(ref_time), channel_group, len, data); + + if (new_write_pos > This->size) + return DMUS_E_BUFFER_FULL; + + if (!This->write_pos) + This->start_time = ref_time; + + header = (DMUS_EVENTHEADER*)&This->data[This->write_pos]; + header->cbEvent = len; + header->dwChannelGroup = channel_group; + header->rtDelta = ref_time - This->start_time; + header->dwFlags = 0; + + memcpy(&header[1], data, len); + This->write_pos = new_write_pos; return S_OK; }
1
0
0
0
Michael Stefaniuc : dmusic: Use DMUS_EVENT_SIZE() to calculate the size of the message.
by Alexandre Julliard
01 May '17
01 May '17
Module: wine Branch: master Commit: 4fbae8eab482fc8d77e22bb487563746d280078b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4fbae8eab482fc8d77e22bb48…
Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Mon May 1 02:15:50 2017 +0200 dmusic: Use DMUS_EVENT_SIZE() to calculate the size of the message. Suggested by Michael Müller. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dmusic/buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/dmusic/buffer.c b/dlls/dmusic/buffer.c index bd0ad1a..eecacbb 100644 --- a/dlls/dmusic/buffer.c +++ b/dlls/dmusic/buffer.c @@ -100,7 +100,7 @@ static HRESULT WINAPI IDirectMusicBufferImpl_TotalTime(LPDIRECTMUSICBUFFER iface static HRESULT WINAPI IDirectMusicBufferImpl_PackStructured(LPDIRECTMUSICBUFFER iface, REFERENCE_TIME ref_time, DWORD channel_group, DWORD channel_message) { IDirectMusicBufferImpl *This = impl_from_IDirectMusicBuffer(iface); - DWORD new_write_pos = This->write_pos + sizeof(DMUS_EVENTHEADER) + sizeof(DWORD); + DWORD new_write_pos = This->write_pos + DMUS_EVENT_SIZE(sizeof(channel_message)); DMUS_EVENTHEADER header; TRACE("(%p)->(0x%s, %u, 0x%x)\n", iface, wine_dbgstr_longlong(ref_time), channel_group, channel_message);
1
0
0
0
Jacek Caban : jscript/tests: Added more exception tests.
by Alexandre Julliard
01 May '17
01 May '17
Module: wine Branch: master Commit: 4b5291a519f8dd5b4e3d9eb73da6f77ea32989f8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4b5291a519f8dd5b4e3d9eb73…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon May 1 18:31:13 2017 +0200 jscript/tests: Added more exception tests. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/jscript/tests/lang.js | 158 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 158 insertions(+) diff --git a/dlls/jscript/tests/lang.js b/dlls/jscript/tests/lang.js index 01d41d5..aba6dda 100644 --- a/dlls/jscript/tests/lang.js +++ b/dlls/jscript/tests/lang.js @@ -981,6 +981,164 @@ case 3: return i; })(); +(function() { + var ret, x; + + function unreachable() { + ok(false, "unreachable"); + } + + function expect(value, expect_value) { + ok(value === expect_value, "got " + value + " expected " + expect_value); + } + + ret = (function() { + try { + return "try"; + unreachable(); + }catch(e) { + unreachable(); + }finally { + return "finally"; + unreachable(); + } + unreachable(); + })(); + expect(ret, "finally"); + + x = ""; + ret = (function() { + try { + x += "try,"; + return x; + unreachable(); + }catch(e) { + unreachable(); + }finally { + x += "finally,"; + } + unreachable(); + })(); + expect(ret, "try,"); + expect(x, "try,finally,"); + + x = ""; + ret = (function() { + try { + x += "try," + throw 1; + unreachable(); + }catch(e) { + x += "catch,"; + return "catch"; + unreachable(); + }finally { + x += "finally,"; + return "finally"; + unreachable(); + } + unreachable(); + })(); + expect(ret, "finally"); + expect(x, "try,catch,finally,"); + + x = ""; + ret = (function() { + try { + x += "try," + throw 1; + unreachable(); + }catch(e) { + x += "catch,"; + return "catch"; + unreachable(); + }finally { + x += "finally,"; + } + unreachable(); + })(); + expect(ret, "catch"); + expect(x, "try,catch,finally,"); + + x = ""; + ret = (function() { + try { + x += "try," + try { + x += "try2,"; + return "try2"; + }catch(e) { + unreachable(); + }finally { + x += "finally2,"; + } + unreachable(); + }catch(e) { + unreachable(); + }finally { + x += "finally,"; + } + unreachable(); + })(); + expect(ret, "try2"); + expect(x, "try,try2,finally2,finally,"); + + x = ""; + ret = (function() { + while(true) { + try { + x += "try," + try { + x += "try2,"; + break; + }catch(e) { + unreachable(); + }finally { + x += "finally2,"; + } + unreachable(); + }catch(e) { + unreachable(); + }finally { + x += "finally,"; + } + unreachable(); + } + x += "ret"; + return "ret"; + })(); + expect(ret, "ret"); + expect(x, "try,try2,finally2,finally,ret"); + + x = ""; + ret = (function() { + while(true) { + try { + x += "try," + try { + x += "try2,"; + continue; + }catch(e) { + unreachable(); + }finally { + x += "finally2,"; + } + unreachable(); + }catch(e) { + unreachable(); + }finally { + x += "finally,"; + break; + } + unreachable(); + } + x += "ret"; + return "ret"; + })(); + expect(ret, "ret"); + expect(x, "try,try2,finally2,finally,ret"); +})(); + tmp = eval("1"); ok(tmp === 1, "eval(\"1\") !== 1"); eval("{ ok(tmp === 1, 'eval: tmp !== 1'); } tmp = 2;");
1
0
0
0
Jacek Caban : jscript: Always jump to finally block from OP_pop_exept when available.
by Alexandre Julliard
01 May '17
01 May '17
Module: wine Branch: master Commit: 60232cc770c12349465c032deecdbb4f18c54660 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=60232cc770c12349465c032de…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon May 1 18:31:02 2017 +0200 jscript: Always jump to finally block from OP_pop_exept when available. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/jscript/compile.c | 45 +++++++++++++++++++++++++-------------------- dlls/jscript/engine.c | 50 +++++++++++++++++++++++++++++++------------------- dlls/jscript/engine.h | 6 +++--- 3 files changed, 59 insertions(+), 42 deletions(-) diff --git a/dlls/jscript/compile.c b/dlls/jscript/compile.c index f9f70f0..61c4077 100644 --- a/dlls/jscript/compile.c +++ b/dlls/jscript/compile.c @@ -1399,8 +1399,9 @@ static HRESULT pop_to_stat(compiler_ctx_t *ctx, statement_ctx_t *stat_ctx) return hres; stack_pop = 0; } - if(!push_instr(ctx, OP_pop_except)) - return E_OUTOFMEMORY; + hres = push_instr_uint(ctx, OP_pop_except, ctx->code_off+1); + if(FAILED(hres)) + return hres; } stack_pop += iter->stack_use; } @@ -1688,9 +1689,8 @@ static HRESULT compile_throw_statement(compiler_ctx_t *ctx, expression_statement /* ECMA-262 3rd Edition 12.14 */ static HRESULT compile_try_statement(compiler_ctx_t *ctx, try_statement_t *stat) { - statement_ctx_t try_ctx = {0, FALSE, TRUE}, catch_ctx = {0, TRUE, FALSE}; - statement_ctx_t finally_ctx = {2, FALSE, FALSE}; - unsigned push_except, finally_off = 0, catch_off = 0; + statement_ctx_t try_ctx = {0, FALSE, TRUE}, finally_ctx = {2, FALSE, FALSE}; + unsigned push_except, finally_off = 0, catch_off = 0, pop_except, catch_pop_except = 0; BSTR ident; HRESULT hres; @@ -1706,24 +1706,19 @@ static HRESULT compile_try_statement(compiler_ctx_t *ctx, try_statement_t *stat) ident = NULL; } - instr_ptr(ctx, push_except)->u.arg[1].bstr = ident; - - if(!stat->catch_block) - try_ctx.stack_use = 2; - hres = compile_statement(ctx, &try_ctx, stat->try_statement); if(FAILED(hres)) return hres; - if(!push_instr(ctx, OP_pop_except)) + pop_except = push_instr(ctx, OP_pop_except); + if(!pop_except) return E_OUTOFMEMORY; if(stat->catch_block) { - unsigned jmp_finally; + statement_ctx_t catch_ctx = {0, TRUE, stat->finally_statement != NULL}; - jmp_finally = push_instr(ctx, OP_jmp); - if(!jmp_finally) - return E_OUTOFMEMORY; + if(stat->finally_statement) + catch_ctx.using_except = TRUE; catch_off = ctx->code_off; @@ -1738,21 +1733,31 @@ static HRESULT compile_try_statement(compiler_ctx_t *ctx, try_statement_t *stat) if(!push_instr(ctx, OP_pop_scope)) return E_OUTOFMEMORY; - set_arg_uint(ctx, jmp_finally, ctx->code_off); - }else { - set_arg_uint(ctx, push_except, ctx->code_off); + if(stat->finally_statement) { + catch_pop_except = push_instr(ctx, OP_pop_except); + if(!catch_pop_except) + return E_OUTOFMEMORY; + } } if(stat->finally_statement) { + /* + * finally block expects two elements on the stack, which may be: + * - (true, return_addr) set by OP_pop_except, OP_end_finally jumps back to passed addres + * - (false, exception_value) set when unwinding an exception, which OP_end_finally rethrows + */ finally_off = ctx->code_off; - hres = compile_statement(ctx, stat->catch_block ? NULL : &finally_ctx, stat->finally_statement); + hres = compile_statement(ctx, &finally_ctx, stat->finally_statement); if(FAILED(hres)) return hres; - if(!stat->catch_block && !push_instr(ctx, OP_end_finally)) + if(!push_instr(ctx, OP_end_finally)) return E_OUTOFMEMORY; } + instr_ptr(ctx, pop_except)->u.arg[0].uint = ctx->code_off; + if(catch_pop_except) + instr_ptr(ctx, catch_pop_except)->u.arg[0].uint = ctx->code_off; instr_ptr(ctx, push_except)->u.arg[0].uint = catch_off; instr_ptr(ctx, push_except)->u.arg[1].uint = finally_off; return S_OK; diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c index d012d7c..c9e856c 100644 --- a/dlls/jscript/engine.c +++ b/dlls/jscript/engine.c @@ -901,28 +901,14 @@ static HRESULT interp_push_except(script_ctx_t *ctx) const unsigned finally_off = get_op_uint(ctx, 1); call_frame_t *frame = ctx->call_ctx; except_frame_t *except; - unsigned stack_top; TRACE("\n"); - stack_top = ctx->stack_top; - - if(!catch_off) { - HRESULT hres; - - hres = stack_push(ctx, jsval_bool(TRUE)); - if(FAILED(hres)) - return hres; - hres = stack_push(ctx, jsval_bool(TRUE)); - if(FAILED(hres)) - return hres; - } - except = heap_alloc(sizeof(*except)); if(!except) return E_OUTOFMEMORY; - except->stack_top = stack_top; + except->stack_top = ctx->stack_top; except->scope = frame->scope; except->catch_off = catch_off; except->finally_off = finally_off; @@ -934,22 +920,41 @@ static HRESULT interp_push_except(script_ctx_t *ctx) /* ECMA-262 3rd Edition 12.14 */ static HRESULT interp_pop_except(script_ctx_t *ctx) { + const unsigned ret_off = get_op_uint(ctx, 0); call_frame_t *frame = ctx->call_ctx; except_frame_t *except; + unsigned finally_off; - TRACE("\n"); + TRACE("%u\n", ret_off); except = frame->except_frame; assert(except != NULL); + finally_off = except->finally_off; frame->except_frame = except->next; heap_free(except); + + if(finally_off) { + HRESULT hres; + + hres = stack_push(ctx, jsval_number(ret_off)); + if(FAILED(hres)) + return hres; + hres = stack_push(ctx, jsval_bool(TRUE)); + if(FAILED(hres)) + return hres; + frame->ip = finally_off; + }else { + frame->ip = ret_off; + } + return S_OK; } /* ECMA-262 3rd Edition 12.14 */ static HRESULT interp_end_finally(script_ctx_t *ctx) { + call_frame_t *frame = ctx->call_ctx; jsval_t v; TRACE("\n"); @@ -964,7 +969,9 @@ static HRESULT interp_end_finally(script_ctx_t *ctx) return DISP_E_EXCEPTION; } - stack_pop(ctx); + v = stack_pop(ctx); + assert(is_number(v)); + frame->ip = get_number(v); return S_OK; } @@ -2676,7 +2683,6 @@ static HRESULT unwind_exception(script_ctx_t *ctx, HRESULT exception_hres) except_frame = frame->except_frame; catch_off = except_frame->catch_off; - frame->except_frame = except_frame->next; assert(except_frame->stack_top <= ctx->stack_top); stack_popn(ctx, ctx->stack_top - except_frame->stack_top); @@ -2691,7 +2697,13 @@ static HRESULT unwind_exception(script_ctx_t *ctx, HRESULT exception_hres) ctx->ei.val = jsval_undefined(); clear_ei(ctx); - heap_free(except_frame); + /* keep current except_frame if we're entering catch block with finally block associated */ + if(catch_off && except_frame->finally_off) { + except_frame->catch_off = 0; + }else { + frame->except_frame = except_frame->next; + heap_free(except_frame); + } hres = stack_push(ctx, except_val); if(FAILED(hres)) diff --git a/dlls/jscript/engine.h b/dlls/jscript/engine.h index 4992061..121a2c2 100644 --- a/dlls/jscript/engine.h +++ b/dlls/jscript/engine.h @@ -34,7 +34,7 @@ X(delete_ident,1,ARG_BSTR, 0) \ X(div, 1, 0,0) \ X(double, 1, ARG_DBL, 0) \ - X(end_finally,1, 0,0) \ + X(end_finally,0, 0,0) \ X(enter_catch,1, ARG_BSTR, 0) \ X(eq, 1, 0,0) \ X(eq2, 1, 0,0) \ @@ -68,7 +68,7 @@ X(obj_prop, 1, ARG_BSTR, 0) \ X(or, 1, 0,0) \ X(pop, 1, ARG_UINT, 0) \ - X(pop_except, 1, 0,0) \ + X(pop_except, 0, ARG_ADDR, 0) \ X(pop_scope, 1, 0,0) \ X(postinc, 1, ARG_INT, 0) \ X(preinc, 1, ARG_INT, 0) \ @@ -88,7 +88,7 @@ X(typeofid, 1, 0,0) \ X(typeofident,1, 0,0) \ X(refval, 1, 0,0) \ - X(ret, 0, 0,0) \ + X(ret, 0, ARG_UINT, 0) \ X(setret, 1, 0,0) \ X(sub, 1, 0,0) \ X(undefined, 1, 0,0) \
1
0
0
0
Jacek Caban : jscript: Pass finally offset instead of catch ident to OP_push_except.
by Alexandre Julliard
01 May '17
01 May '17
Module: wine Branch: master Commit: 685cd437c9818b03e17393178f4beb7b0be61e52 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=685cd437c9818b03e17393178…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon May 1 18:30:44 2017 +0200 jscript: Pass finally offset instead of catch ident to OP_push_except. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/jscript/compile.c | 7 +++++-- dlls/jscript/engine.c | 22 +++++++++++----------- dlls/jscript/engine.h | 2 +- 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/dlls/jscript/compile.c b/dlls/jscript/compile.c index 6a818ac..f9f70f0 100644 --- a/dlls/jscript/compile.c +++ b/dlls/jscript/compile.c @@ -1690,7 +1690,7 @@ static HRESULT compile_try_statement(compiler_ctx_t *ctx, try_statement_t *stat) { statement_ctx_t try_ctx = {0, FALSE, TRUE}, catch_ctx = {0, TRUE, FALSE}; statement_ctx_t finally_ctx = {2, FALSE, FALSE}; - unsigned push_except; + unsigned push_except, finally_off = 0, catch_off = 0; BSTR ident; HRESULT hres; @@ -1725,7 +1725,7 @@ static HRESULT compile_try_statement(compiler_ctx_t *ctx, try_statement_t *stat) if(!jmp_finally) return E_OUTOFMEMORY; - instr_ptr(ctx, push_except)->u.arg[0].uint = ctx->code_off; + catch_off = ctx->code_off; hres = push_instr_bstr(ctx, OP_enter_catch, ident); if(FAILED(hres)) @@ -1744,6 +1744,7 @@ static HRESULT compile_try_statement(compiler_ctx_t *ctx, try_statement_t *stat) } if(stat->finally_statement) { + finally_off = ctx->code_off; hres = compile_statement(ctx, stat->catch_block ? NULL : &finally_ctx, stat->finally_statement); if(FAILED(hres)) return hres; @@ -1752,6 +1753,8 @@ static HRESULT compile_try_statement(compiler_ctx_t *ctx, try_statement_t *stat) return E_OUTOFMEMORY; } + instr_ptr(ctx, push_except)->u.arg[0].uint = catch_off; + instr_ptr(ctx, push_except)->u.arg[1].uint = finally_off; return S_OK; } diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c index 4aee171..d012d7c 100644 --- a/dlls/jscript/engine.c +++ b/dlls/jscript/engine.c @@ -41,7 +41,7 @@ struct _except_frame_t { unsigned stack_top; scope_chain_t *scope; unsigned catch_off; - BSTR ident; + unsigned finally_off; except_frame_t *next; }; @@ -897,8 +897,8 @@ static HRESULT interp_throw_type(script_ctx_t *ctx) /* ECMA-262 3rd Edition 12.14 */ static HRESULT interp_push_except(script_ctx_t *ctx) { - const unsigned arg1 = get_op_uint(ctx, 0); - const BSTR arg2 = get_op_bstr(ctx, 1); + const unsigned catch_off = get_op_uint(ctx, 0); + const unsigned finally_off = get_op_uint(ctx, 1); call_frame_t *frame = ctx->call_ctx; except_frame_t *except; unsigned stack_top; @@ -907,7 +907,7 @@ static HRESULT interp_push_except(script_ctx_t *ctx) stack_top = ctx->stack_top; - if(!arg2) { + if(!catch_off) { HRESULT hres; hres = stack_push(ctx, jsval_bool(TRUE)); @@ -924,8 +924,8 @@ static HRESULT interp_push_except(script_ctx_t *ctx) except->stack_top = stack_top; except->scope = frame->scope; - except->catch_off = arg1; - except->ident = arg2; + except->catch_off = catch_off; + except->finally_off = finally_off; except->next = frame->except_frame; frame->except_frame = except; return S_OK; @@ -2657,7 +2657,7 @@ static HRESULT unwind_exception(script_ctx_t *ctx, HRESULT exception_hres) except_frame_t *except_frame; call_frame_t *frame; jsval_t except_val; - BSTR ident; + unsigned catch_off; HRESULT hres; for(frame = ctx->call_ctx; !frame->except_frame; frame = ctx->call_ctx) { @@ -2675,7 +2675,7 @@ static HRESULT unwind_exception(script_ctx_t *ctx, HRESULT exception_hres) } except_frame = frame->except_frame; - ident = except_frame->ident; + catch_off = except_frame->catch_off; frame->except_frame = except_frame->next; assert(except_frame->stack_top <= ctx->stack_top); @@ -2684,8 +2684,8 @@ static HRESULT unwind_exception(script_ctx_t *ctx, HRESULT exception_hres) while(except_frame->scope != frame->scope) scope_pop(&frame->scope); - frame->ip = except_frame->catch_off; - if(ident) assert(frame->bytecode->instrs[frame->ip].op == OP_enter_catch); + frame->ip = catch_off ? catch_off : except_frame->finally_off; + if(catch_off) assert(frame->bytecode->instrs[frame->ip].op == OP_enter_catch); except_val = ctx->ei.val; ctx->ei.val = jsval_undefined(); @@ -2697,7 +2697,7 @@ static HRESULT unwind_exception(script_ctx_t *ctx, HRESULT exception_hres) if(FAILED(hres)) return hres; - if(!ident) + if(!catch_off) hres = stack_push(ctx, jsval_bool(FALSE)); return hres; } diff --git a/dlls/jscript/engine.h b/dlls/jscript/engine.h index bf74576..4992061 100644 --- a/dlls/jscript/engine.h +++ b/dlls/jscript/engine.h @@ -72,7 +72,7 @@ X(pop_scope, 1, 0,0) \ X(postinc, 1, ARG_INT, 0) \ X(preinc, 1, ARG_INT, 0) \ - X(push_except,1, ARG_ADDR, ARG_BSTR) \ + X(push_except,1, ARG_ADDR, ARG_UINT) \ X(push_ret, 1, 0,0) \ X(push_scope, 1, 0,0) \ X(regexp, 1, ARG_STR, ARG_UINT) \
1
0
0
0
Jacek Caban : jscript: Ensure that OP_pop_except is called with proper stack depth.
by Alexandre Julliard
01 May '17
01 May '17
Module: wine Branch: master Commit: 8bd99c363a385ed0191987a7c069b0fe99bc374a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8bd99c363a385ed0191987a7c…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon May 1 18:30:18 2017 +0200 jscript: Ensure that OP_pop_except is called with proper stack depth. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/jscript/compile.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/dlls/jscript/compile.c b/dlls/jscript/compile.c index 662326b..6a818ac 100644 --- a/dlls/jscript/compile.c +++ b/dlls/jscript/compile.c @@ -1387,18 +1387,25 @@ static HRESULT pop_to_stat(compiler_ctx_t *ctx, statement_ctx_t *stat_ctx) { unsigned stack_pop = 0; statement_ctx_t *iter; + HRESULT hres; for(iter = ctx->stat_ctx; iter != stat_ctx; iter = iter->next) { if(iter->using_scope && !push_instr(ctx, OP_pop_scope)) return E_OUTOFMEMORY; - if(iter->using_except && !push_instr(ctx, OP_pop_except)) - return E_OUTOFMEMORY; + if(iter->using_except) { + if(stack_pop) { + hres = push_instr_uint(ctx, OP_pop, stack_pop); + if(FAILED(hres)) + return hres; + stack_pop = 0; + } + if(!push_instr(ctx, OP_pop_except)) + return E_OUTOFMEMORY; + } stack_pop += iter->stack_use; } if(stack_pop) { - HRESULT hres; - hres = push_instr_uint(ctx, OP_pop, stack_pop); if(FAILED(hres)) return hres;
1
0
0
0
Jacek Caban : jscript: Added new opcode to enter catch block and use it to setup the scope.
by Alexandre Julliard
01 May '17
01 May '17
Module: wine Branch: master Commit: 622eb728d75b701b6ab54312a1ac7627993fb92c URL:
http://source.winehq.org/git/wine.git/?a=commit;h=622eb728d75b701b6ab54312a…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon May 1 18:30:06 2017 +0200 jscript: Added new opcode to enter catch block and use it to setup the scope. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/jscript/compile.c | 4 ++++ dlls/jscript/engine.c | 48 ++++++++++++++++++++++++++---------------------- dlls/jscript/engine.h | 1 + 3 files changed, 31 insertions(+), 22 deletions(-) diff --git a/dlls/jscript/compile.c b/dlls/jscript/compile.c index 3770767..662326b 100644 --- a/dlls/jscript/compile.c +++ b/dlls/jscript/compile.c @@ -1720,6 +1720,10 @@ static HRESULT compile_try_statement(compiler_ctx_t *ctx, try_statement_t *stat) instr_ptr(ctx, push_except)->u.arg[0].uint = ctx->code_off; + hres = push_instr_bstr(ctx, OP_enter_catch, ident); + if(FAILED(hres)) + return hres; + hres = compile_statement(ctx, &catch_ctx, stat->catch_block->statement); if(FAILED(hres)) return hres; diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c index 90e6f8f..4aee171 100644 --- a/dlls/jscript/engine.c +++ b/dlls/jscript/engine.c @@ -968,6 +968,26 @@ static HRESULT interp_end_finally(script_ctx_t *ctx) return S_OK; } +static HRESULT interp_enter_catch(script_ctx_t *ctx) +{ + const BSTR ident = get_op_bstr(ctx, 0); + jsdisp_t *scope_obj; + jsval_t v; + HRESULT hres; + + hres = create_dispex(ctx, NULL, NULL, &scope_obj); + if(FAILED(hres)) + return hres; + + v = stack_pop(ctx); + hres = jsdisp_propput_name(scope_obj, ident, v); + jsval_release(v); + if(SUCCEEDED(hres)) + hres = scope_push(ctx->call_ctx->scope, scope_obj, to_disp(scope_obj), &ctx->call_ctx->scope); + jsdisp_release(scope_obj); + return hres; +} + /* ECMA-262 3rd Edition 13 */ static HRESULT interp_func(script_ctx_t *ctx) { @@ -2655,6 +2675,7 @@ static HRESULT unwind_exception(script_ctx_t *ctx, HRESULT exception_hres) } except_frame = frame->except_frame; + ident = except_frame->ident; frame->except_frame = except_frame->next; assert(except_frame->stack_top <= ctx->stack_top); @@ -2664,37 +2685,20 @@ static HRESULT unwind_exception(script_ctx_t *ctx, HRESULT exception_hres) scope_pop(&frame->scope); frame->ip = except_frame->catch_off; + if(ident) assert(frame->bytecode->instrs[frame->ip].op == OP_enter_catch); except_val = ctx->ei.val; ctx->ei.val = jsval_undefined(); clear_ei(ctx); - ident = except_frame->ident; heap_free(except_frame); - if(ident) { - jsdisp_t *scope_obj; - - hres = create_dispex(ctx, NULL, NULL, &scope_obj); - if(SUCCEEDED(hres)) { - hres = jsdisp_propput_name(scope_obj, ident, except_val); - if(FAILED(hres)) - jsdisp_release(scope_obj); - } - jsval_release(except_val); - if(FAILED(hres)) - return hres; - - hres = scope_push(frame->scope, scope_obj, to_disp(scope_obj), &frame->scope); - jsdisp_release(scope_obj); - }else { - hres = stack_push(ctx, except_val); - if(FAILED(hres)) - return hres; + hres = stack_push(ctx, except_val); + if(FAILED(hres)) + return hres; + if(!ident) hres = stack_push(ctx, jsval_bool(FALSE)); - } - return hres; } diff --git a/dlls/jscript/engine.h b/dlls/jscript/engine.h index f5b484b..bf74576 100644 --- a/dlls/jscript/engine.h +++ b/dlls/jscript/engine.h @@ -35,6 +35,7 @@ X(div, 1, 0,0) \ X(double, 1, ARG_DBL, 0) \ X(end_finally,1, 0,0) \ + X(enter_catch,1, ARG_BSTR, 0) \ X(eq, 1, 0,0) \ X(eq2, 1, 0,0) \ X(forin, 0, ARG_ADDR, 0) \
1
0
0
0
Jacek Caban : jscript: Simplify pop_to_stat implementation.
by Alexandre Julliard
01 May '17
01 May '17
Module: wine Branch: master Commit: b7bb16673c75ef3e5f49493aa9deeb0255f822bd URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b7bb16673c75ef3e5f49493aa…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon May 1 18:29:53 2017 +0200 jscript: Simplify pop_to_stat implementation. We no longer need to do stack pops before return expression evaluation. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/jscript/compile.c | 24 +++++++++--------------- dlls/jscript/tests/lang.js | 11 +++++++++++ 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/dlls/jscript/compile.c b/dlls/jscript/compile.c index fe3e043..3770767 100644 --- a/dlls/jscript/compile.c +++ b/dlls/jscript/compile.c @@ -1383,22 +1383,20 @@ static HRESULT compile_forin_statement(compiler_ctx_t *ctx, forin_statement_t *s return S_OK; } -static HRESULT pop_to_stat(compiler_ctx_t *ctx, BOOL var_stack, BOOL scope_stack, statement_ctx_t *stat_ctx) +static HRESULT pop_to_stat(compiler_ctx_t *ctx, statement_ctx_t *stat_ctx) { unsigned stack_pop = 0; statement_ctx_t *iter; for(iter = ctx->stat_ctx; iter != stat_ctx; iter = iter->next) { - if(scope_stack) { - if(iter->using_scope && !push_instr(ctx, OP_pop_scope)) - return E_OUTOFMEMORY; - if(iter->using_except && !push_instr(ctx, OP_pop_except)) - return E_OUTOFMEMORY; - } + if(iter->using_scope && !push_instr(ctx, OP_pop_scope)) + return E_OUTOFMEMORY; + if(iter->using_except && !push_instr(ctx, OP_pop_except)) + return E_OUTOFMEMORY; stack_pop += iter->stack_use; } - if(var_stack && stack_pop) { + if(stack_pop) { HRESULT hres; hres = push_instr_uint(ctx, OP_pop, stack_pop); @@ -1455,7 +1453,7 @@ static HRESULT compile_continue_statement(compiler_ctx_t *ctx, branch_statement_ } } - hres = pop_to_stat(ctx, TRUE, TRUE, pop_ctx); + hres = pop_to_stat(ctx, pop_ctx); if(FAILED(hres)) return hres; @@ -1492,7 +1490,7 @@ static HRESULT compile_break_statement(compiler_ctx_t *ctx, branch_statement_t * } } - hres = pop_to_stat(ctx, TRUE, TRUE, pop_ctx->next); + hres = pop_to_stat(ctx, pop_ctx->next); if(FAILED(hres)) return hres; @@ -1509,10 +1507,6 @@ static HRESULT compile_return_statement(compiler_ctx_t *ctx, expression_statemen return JS_E_MISPLACED_RETURN; } - hres = pop_to_stat(ctx, TRUE, FALSE, NULL); - if(FAILED(hres)) - return hres; - if(stat->expr) { hres = compile_expression(ctx, stat->expr, TRUE); if(FAILED(hres)) @@ -1521,7 +1515,7 @@ static HRESULT compile_return_statement(compiler_ctx_t *ctx, expression_statemen return E_OUTOFMEMORY; } - hres = pop_to_stat(ctx, FALSE, TRUE, NULL); + hres = pop_to_stat(ctx, NULL); if(FAILED(hres)) return hres; diff --git a/dlls/jscript/tests/lang.js b/dlls/jscript/tests/lang.js index c179265..01d41d5 100644 --- a/dlls/jscript/tests/lang.js +++ b/dlls/jscript/tests/lang.js @@ -264,6 +264,8 @@ ok(tmp === 3, "tmp = " + tmp); eval("testRes(); testRes()"); tmp = eval("3; if(false) {4;} else {};;;") ok(tmp === 3, "tmp = " + tmp); +tmp = eval("try { 1; } finally { 2; }") +ok(tmp === 2, "tmp = " + tmp); testNoRes(); testRes() && testRes(); @@ -1597,6 +1599,15 @@ tmp = (function() { })(); ok(tmp, "tmp = " + tmp); +tmp = (function() { + for(var iter in [1,2,3,4]) { + var ret = false; + with({ret: true}) + return ret; + } +})(); +ok(tmp, "tmp = " + tmp); + (function() { ok(typeof(func) === "function", "typeof(func) = " + typeof(func)); with(new Object()) {
1
0
0
0
Akihiro Sagawa : rsaenh: Don't import a public key to a key container.
by Alexandre Julliard
01 May '17
01 May '17
Module: wine Branch: master Commit: e705dfc27f15164e8f2cdd17cf505c19d78415e2 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e705dfc27f15164e8f2cdd17c…
Author: Akihiro Sagawa <sagawa.aki(a)gmail.com> Date: Sun Apr 30 22:30:42 2017 +0900 rsaenh: Don't import a public key to a key container. Signed-off-by: Akihiro Sagawa <sagawa.aki(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/rsaenh/rsaenh.c | 21 ++++----------------- dlls/rsaenh/tests/rsaenh.c | 2 +- 2 files changed, 5 insertions(+), 18 deletions(-) diff --git a/dlls/rsaenh/rsaenh.c b/dlls/rsaenh/rsaenh.c index ebafa0e..9af770d 100644 --- a/dlls/rsaenh/rsaenh.c +++ b/dlls/rsaenh/rsaenh.c @@ -2822,15 +2822,14 @@ static BOOL import_private_key(HCRYPTPROV hProv, const BYTE *pbData, DWORD dwDat /****************************************************************************** * import_public_key [Internal] * - * Import a BLOB'ed public key into a key container. + * Import a BLOB'ed public key. * * PARAMS - * hProv [I] Key container into which the public key is to be imported. + * hProv [I] A CSP. * pbData [I] Pointer to a buffer which holds the public key BLOB. * dwDataLen [I] Length of data in buffer at pbData. * dwFlags [I] One of: * CRYPT_EXPORTABLE: the imported key is marked exportable - * fStoreKey [I] If TRUE, the imported key is stored to the registry. * phKey [O] Handle to the imported key. * * @@ -2843,9 +2842,8 @@ static BOOL import_private_key(HCRYPTPROV hProv, const BYTE *pbData, DWORD dwDat * Failure: FALSE. */ static BOOL import_public_key(HCRYPTPROV hProv, const BYTE *pbData, DWORD dwDataLen, - DWORD dwFlags, BOOL fStoreKey, HCRYPTKEY *phKey) + DWORD dwFlags, HCRYPTKEY *phKey) { - KEYCONTAINER *pKeyContainer; CRYPTKEY *pCryptKey; const BLOBHEADER *pBlobHeader = (const BLOBHEADER*)pbData; const RSAPUBKEY *pRSAPubKey = (const RSAPUBKEY*)(pBlobHeader+1); @@ -2858,8 +2856,6 @@ static BOOL import_public_key(HCRYPTPROV hProv, const BYTE *pbData, DWORD dwData SetLastError(NTE_BAD_FLAGS); return FALSE; } - if (!(pKeyContainer = get_key_container(hProv))) - return FALSE; if ((dwDataLen < sizeof(BLOBHEADER) + sizeof(RSAPUBKEY)) || (pRSAPubKey->magic != RSAENH_MAGIC_RSA1) || @@ -2881,15 +2877,6 @@ static BOOL import_public_key(HCRYPTPROV hProv, const BYTE *pbData, DWORD dwData if (ret) { if (dwFlags & CRYPT_EXPORTABLE) pCryptKey->dwPermissions |= CRYPT_EXPORT; - switch (pBlobHeader->aiKeyAlg) - { - case AT_KEYEXCHANGE: - case CALG_RSA_KEYX: - TRACE("installing public key\n"); - release_and_install_key(hProv, *phKey, &pKeyContainer->hKeyExchangeKeyPair, - fStoreKey); - break; - } } return ret; } @@ -3103,7 +3090,7 @@ static BOOL import_key(HCRYPTPROV hProv, const BYTE *pbData, DWORD dwDataLen, HC case PUBLICKEYBLOB: return import_public_key(hProv, pbData, dwDataLen, dwFlags, - fStoreKey, phKey); + phKey); case SIMPLEBLOB: return import_symmetric_key(hProv, pbData, dwDataLen, hPubKey, diff --git a/dlls/rsaenh/tests/rsaenh.c b/dlls/rsaenh/tests/rsaenh.c index 839527b..c9532b2 100644 --- a/dlls/rsaenh/tests/rsaenh.c +++ b/dlls/rsaenh/tests/rsaenh.c @@ -2642,7 +2642,7 @@ static void test_import_export(void) CryptDestroyKey(hPrivKey); result = !memcmp(exported_key, exported_key2, dwDataLen); - todo_wine ok(result, "unexpected value\n"); + ok(result, "unexpected value\n"); if (!result && winetest_debug > 1) { trace("Expected public key (%u):\n", dwDataLen); trace_hex(exported_key, dwDataLen);
1
0
0
0
← Newer
1
...
59
60
61
62
63
64
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
Results per page:
10
25
50
100
200