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
April
March
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
November 2011
----- 2025 -----
April 2025
March 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
852 discussions
Start a n
N
ew thread
Frédéric Delanoy : winefile: Avoid uninitialized field in SYSTEMTIME structure (Coverity).
by Alexandre Julliard
25 Nov '11
25 Nov '11
Module: wine Branch: master Commit: f38e0be5ea11784410c6e0781c72b194fc95fd14 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f38e0be5ea11784410c6e0781…
Author: Frédéric Delanoy <frederic.delanoy(a)gmail.com> Date: Fri Nov 25 14:55:40 2011 +0100 winefile: Avoid uninitialized field in SYSTEMTIME structure (Coverity). --- programs/winefile/winefile.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/programs/winefile/winefile.c b/programs/winefile/winefile.c index 7876da5..63ce463 100644 --- a/programs/winefile/winefile.c +++ b/programs/winefile/winefile.c @@ -526,6 +526,7 @@ static BOOL time_to_filetime(const time_t* t, FILETIME* ftime) stime.wHour = tm->tm_hour; stime.wMinute = tm->tm_min; stime.wSecond = tm->tm_sec; + stime.wMilliseconds = 0; return SystemTimeToFileTime(&stime, ftime); }
1
0
0
0
Hans Leidekker : winhttp: Resolve the server name only on the first request .
by Alexandre Julliard
25 Nov '11
25 Nov '11
Module: wine Branch: master Commit: 7d8730f8c5d36dbe450ba415d1d3a0ba119289e8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7d8730f8c5d36dbe450ba415d…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Fri Nov 25 14:55:13 2011 +0100 winhttp: Resolve the server name only on the first request. --- dlls/winhttp/request.c | 63 +++++++++++++++++++++++-------------- dlls/winhttp/session.c | 6 ++-- dlls/winhttp/tests/notification.c | 59 ++++++++++++++++++++++++++++++++++ dlls/winhttp/winhttp_private.h | 1 + 4 files changed, 102 insertions(+), 27 deletions(-) diff --git a/dlls/winhttp/request.c b/dlls/winhttp/request.c index a56572d..f610dde 100644 --- a/dlls/winhttp/request.c +++ b/dlls/winhttp/request.c @@ -909,53 +909,68 @@ static BOOL secure_proxy_connect( request_t *request ) #define INET6_ADDRSTRLEN 46 #endif +static WCHAR *addr_to_str( const struct sockaddr *addr ) +{ + char buf[INET6_ADDRSTRLEN]; + const void *src; + + switch (addr->sa_family) + { + case AF_INET: + src = &((struct sockaddr_in *)addr)->sin_addr; + break; + case AF_INET6: + src = &((struct sockaddr_in6 *)addr)->sin6_addr; + break; + default: + WARN("unsupported address family %d\n", addr->sa_family); + return NULL; + } + if (!inet_ntop( addr->sa_family, src, buf, sizeof(buf) )) return NULL; + return strdupAW( buf ); +} + static BOOL open_connection( request_t *request ) { connect_t *connect; - const void *addr; - char address[INET6_ADDRSTRLEN]; - WCHAR *addressW; + WCHAR *addressW = NULL; INTERNET_PORT port; socklen_t slen; + struct sockaddr *saddr; + DWORD len; if (netconn_connected( &request->netconn )) return TRUE; connect = request->connect; port = connect->serverport ? connect->serverport : (request->hdr.flags & WINHTTP_FLAG_SECURE ? 443 : 80); + saddr = (struct sockaddr *)&connect->sockaddr; + slen = sizeof(struct sockaddr); - send_callback( &request->hdr, WINHTTP_CALLBACK_STATUS_RESOLVING_NAME, connect->servername, strlenW(connect->servername) + 1 ); - - slen = sizeof(connect->sockaddr); - if (!netconn_resolve( connect->servername, port, (struct sockaddr *)&connect->sockaddr, &slen, request->resolve_timeout )) return FALSE; - switch (connect->sockaddr.ss_family) + if (!connect->resolved) { - case AF_INET: - addr = &((struct sockaddr_in *)&connect->sockaddr)->sin_addr; - break; - case AF_INET6: - addr = &((struct sockaddr_in6 *)&connect->sockaddr)->sin6_addr; - break; - default: - WARN("unsupported address family %d\n", connect->sockaddr.ss_family); - return FALSE; - } - inet_ntop( connect->sockaddr.ss_family, addr, address, sizeof(address) ); - addressW = strdupAW( address ); + len = strlenW( connect->servername ) + 1; + send_callback( &request->hdr, WINHTTP_CALLBACK_STATUS_RESOLVING_NAME, connect->servername, len ); - send_callback( &request->hdr, WINHTTP_CALLBACK_STATUS_NAME_RESOLVED, addressW, strlenW(addressW) + 1 ); + if (!netconn_resolve( connect->servername, port, saddr, &slen, request->resolve_timeout )) return FALSE; + connect->resolved = TRUE; - TRACE("connecting to %s:%u\n", address, port); + if (!(addressW = addr_to_str( saddr ))) return FALSE; + len = strlenW( addressW ) + 1; + send_callback( &request->hdr, WINHTTP_CALLBACK_STATUS_NAME_RESOLVED, addressW, len ); + } + if (!addressW && !(addressW = addr_to_str( saddr ))) return FALSE; + TRACE("connecting to %s:%u\n", debugstr_w(addressW), port); send_callback( &request->hdr, WINHTTP_CALLBACK_STATUS_CONNECTING_TO_SERVER, addressW, 0 ); - if (!netconn_create( &request->netconn, connect->sockaddr.ss_family, SOCK_STREAM, 0 )) + if (!netconn_create( &request->netconn, saddr->sa_family, SOCK_STREAM, 0 )) { heap_free( addressW ); return FALSE; } netconn_set_timeout( &request->netconn, TRUE, request->send_timeout ); netconn_set_timeout( &request->netconn, FALSE, request->recv_timeout ); - if (!netconn_connect( &request->netconn, (struct sockaddr *)&connect->sockaddr, slen, request->connect_timeout )) + if (!netconn_connect( &request->netconn, saddr, slen, request->connect_timeout )) { netconn_close( &request->netconn ); heap_free( addressW ); diff --git a/dlls/winhttp/session.c b/dlls/winhttp/session.c index 110de80..0f9e782 100644 --- a/dlls/winhttp/session.c +++ b/dlls/winhttp/session.c @@ -423,7 +423,7 @@ BOOL set_server_for_hostname( connect_t *connect, LPCWSTR server, INTERNET_PORT session->proxy_server, colon - session->proxy_server - 1 )) { heap_free( connect->servername ); - connect->sockaddr.ss_family = 0xffff; + connect->resolved = FALSE; if (!(connect->servername = heap_alloc( (colon - session->proxy_server + 1) * sizeof(WCHAR) ))) { @@ -445,7 +445,7 @@ BOOL set_server_for_hostname( connect_t *connect, LPCWSTR server, INTERNET_PORT session->proxy_server )) { heap_free( connect->servername ); - connect->sockaddr.ss_family = 0xffff; + connect->resolved = FALSE; if (!(connect->servername = strdupW( session->proxy_server ))) { ret = FALSE; @@ -458,7 +458,7 @@ BOOL set_server_for_hostname( connect_t *connect, LPCWSTR server, INTERNET_PORT else if (server) { heap_free( connect->servername ); - connect->sockaddr.ss_family = 0xffff; + connect->resolved = FALSE; if (!(connect->servername = strdupW( server ))) { ret = FALSE; diff --git a/dlls/winhttp/tests/notification.c b/dlls/winhttp/tests/notification.c index 7ceede7..84a3569 100644 --- a/dlls/winhttp/tests/notification.c +++ b/dlls/winhttp/tests/notification.c @@ -135,6 +135,16 @@ static const struct notification cache_test[] = { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CLOSING_CONNECTION, 0, 1 }, { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CONNECTION_CLOSED, 0, 1 }, { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING, 0, 1 }, + { winhttp_open_request, WINHTTP_CALLBACK_STATUS_HANDLE_CREATED, 0 }, + { winhttp_send_request, WINHTTP_CALLBACK_STATUS_CONNECTING_TO_SERVER, 0 }, + { winhttp_send_request, WINHTTP_CALLBACK_STATUS_CONNECTED_TO_SERVER, 0 }, + { winhttp_send_request, WINHTTP_CALLBACK_STATUS_SENDING_REQUEST, 0 }, + { winhttp_send_request, WINHTTP_CALLBACK_STATUS_REQUEST_SENT, 0 }, + { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RECEIVING_RESPONSE, 0 }, + { winhttp_receive_response, WINHTTP_CALLBACK_STATUS_RESPONSE_RECEIVED, 0 }, + { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CLOSING_CONNECTION, 0, 1 }, + { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_CONNECTION_CLOSED, 0, 1 }, + { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING, 0, 1 }, { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING, 1, 1 }, { winhttp_close_handle, WINHTTP_CALLBACK_STATUS_HANDLE_CLOSING, 1, 1 } }; @@ -190,6 +200,32 @@ static void test_connection_cache( void ) setup_test( &info, winhttp_close_handle, __LINE__ ); WinHttpCloseHandle( req ); + + setup_test( &info, winhttp_open_request, __LINE__ ); + req = WinHttpOpenRequest( con, NULL, NULL, NULL, NULL, NULL, 0 ); + ok(req != NULL, "failed to open a request %u\n", GetLastError()); + + ret = WinHttpSetOption( req, WINHTTP_OPTION_CONTEXT_VALUE, &context, sizeof(struct info *) ); + ok(ret, "failed to set context value %u\n", GetLastError()); + + setup_test( &info, winhttp_send_request, __LINE__ ); + ret = WinHttpSendRequest( req, NULL, 0, NULL, 0, 0, 0 ); + ok(ret, "failed to send request %u\n", GetLastError()); + + setup_test( &info, winhttp_receive_response, __LINE__ ); + ret = WinHttpReceiveResponse( req, NULL ); + ok(ret, "failed to receive response %u\n", GetLastError()); + + size = sizeof(status); + ret = WinHttpQueryHeaders( req, WINHTTP_QUERY_STATUS_CODE | WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, &size, NULL ); + ok(ret, "failed unexpectedly %u\n", GetLastError()); + ok(status == 200, "request failed unexpectedly %u\n", status); + + setup_test( &info, winhttp_close_handle, __LINE__ ); + WinHttpCloseHandle( req ); + + setup_test( &info, winhttp_close_handle, __LINE__ ); + WinHttpCloseHandle( req ); WinHttpCloseHandle( con ); WinHttpCloseHandle( ses ); @@ -231,6 +267,29 @@ static void test_connection_cache( void ) setup_test( &info, winhttp_close_handle, __LINE__ ); WinHttpCloseHandle( req ); + + setup_test( &info, winhttp_open_request, __LINE__ ); + req = WinHttpOpenRequest( con, NULL, NULL, NULL, NULL, NULL, 0 ); + ok(req != NULL, "failed to open a request %u\n", GetLastError()); + + ret = WinHttpSetOption( req, WINHTTP_OPTION_CONTEXT_VALUE, &context, sizeof(struct info *) ); + ok(ret, "failed to set context value %u\n", GetLastError()); + + setup_test( &info, winhttp_send_request, __LINE__ ); + ret = WinHttpSendRequest( req, NULL, 0, NULL, 0, 0, 0 ); + ok(ret, "failed to send request %u\n", GetLastError()); + + setup_test( &info, winhttp_receive_response, __LINE__ ); + ret = WinHttpReceiveResponse( req, NULL ); + ok(ret, "failed to receive response %u\n", GetLastError()); + + size = sizeof(status); + ret = WinHttpQueryHeaders( req, WINHTTP_QUERY_STATUS_CODE | WINHTTP_QUERY_FLAG_NUMBER, NULL, &status, &size, NULL ); + ok(ret, "failed unexpectedly %u\n", GetLastError()); + ok(status == 200, "request failed unexpectedly %u\n", status); + + setup_test( &info, winhttp_close_handle, __LINE__ ); + WinHttpCloseHandle( req ); WinHttpCloseHandle( con ); WinHttpCloseHandle( ses ); } diff --git a/dlls/winhttp/winhttp_private.h b/dlls/winhttp/winhttp_private.h index fbd5032..7105553 100644 --- a/dlls/winhttp/winhttp_private.h +++ b/dlls/winhttp/winhttp_private.h @@ -119,6 +119,7 @@ typedef struct INTERNET_PORT hostport; INTERNET_PORT serverport; struct sockaddr_storage sockaddr; + BOOL resolved; } connect_t; typedef struct
1
0
0
0
Frédéric Delanoy : po: Update French translation.
by Alexandre Julliard
25 Nov '11
25 Nov '11
Module: wine Branch: master Commit: c724a6155d6d5658addfc22b98e472e3e419c6ef URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c724a6155d6d5658addfc22b9…
Author: Frédéric Delanoy <frederic.delanoy(a)gmail.com> Date: Thu Nov 24 23:06:39 2011 +0100 po: Update French translation. --- po/fr.po | 16 +++++++--------- 1 files changed, 7 insertions(+), 9 deletions(-) diff --git a/po/fr.po b/po/fr.po index c6e5401..8a0edc9 100644 --- a/po/fr.po +++ b/po/fr.po @@ -5681,7 +5681,7 @@ msgstr "Entrez le mot de passe réseau" #: mpr.rc:35 msgid "Please enter your username and password:" -msgstr "Veuillez saisir votre nom d'utilisateur et votre mot de passe :" +msgstr "Veuillez saisir vos nom d'utilisateur et mot de passe :" #: mpr.rc:36 msgid "Proxy" @@ -9396,7 +9396,6 @@ msgid "Unicode (UTF-8)" msgstr "Unicode (UTF-8)" #: notepad.rc:99 -#, fuzzy msgid "" "%1\n" "This file contains Unicode characters which will be lost if\n" @@ -9405,9 +9404,9 @@ msgid "" "one of the Unicode options in the Encoding drop down list.\n" "Continue?" msgstr "" -"%s\n" +"%1\n" "Ce fichier contient des caractères Unicode qui seront perdus si\n" -"vous le sauvez dans le codage %s.\n" +"vous le sauvez dans le codage %2.\n" "Pour conserver ces caractères, cliquez sur Annuler et sélectionnez\n" "une des alternatives Unicode dans la liste déroulante Codage.\n" "Continuer ?" @@ -11240,9 +11239,8 @@ msgid "Processes: %d" msgstr "Processus : %d" #: taskmgr.rc:267 -#, fuzzy msgid "Mem Usage: %1!u!kB / %2!u!kB" -msgstr "Utilisation mémoire : %dK / %dK" +msgstr "Utilisation mémoire : %1!u! ko / %2!u! ko" #: taskmgr.rc:272 msgid "Image Name" @@ -12577,17 +12575,17 @@ msgstr "%1 libres sur %2" #: winefile.rc:121 msgctxt "unit kilobyte" msgid "kB" -msgstr "kB" +msgstr "ko" #: winefile.rc:122 msgctxt "unit megabyte" msgid "MB" -msgstr "MB" +msgstr "Mo" #: winefile.rc:123 msgctxt "unit gigabyte" msgid "GB" -msgstr "GB" +msgstr "Go" #: winemine.rc:34 msgid "&Game"
1
0
0
0
André Hentschel : po: Update German translation.
by Alexandre Julliard
25 Nov '11
25 Nov '11
Module: wine Branch: master Commit: 420e2e99f8b1007e69df4fbd049d67b8ab332990 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=420e2e99f8b1007e69df4fbd0…
Author: André Hentschel <nerv(a)dawncrow.de> Date: Thu Nov 24 22:09:55 2011 +0100 po: Update German translation. --- po/de.po | 10 ++++------ 1 files changed, 4 insertions(+), 6 deletions(-) diff --git a/po/de.po b/po/de.po index e9e2ce1..61f1ef6 100644 --- a/po/de.po +++ b/po/de.po @@ -5,7 +5,7 @@ msgstr "" "Project-Id-Version: Wine\n" "Report-Msgid-Bugs-To:
http://bugs.winehq.org\n
" "POT-Creation-Date: N/A\n" -"PO-Revision-Date: 2011-11-21 20:10+0100\n" +"PO-Revision-Date: 2011-11-24 22:08+0100\n" "Last-Translator: André Hentschel\n" "Language-Team: none\n" "Language: German\n" @@ -9376,7 +9376,6 @@ msgid "Unicode (UTF-8)" msgstr "Unicode (UTF-8)" #: notepad.rc:99 -#, fuzzy msgid "" "%1\n" "This file contains Unicode characters which will be lost if\n" @@ -9385,9 +9384,9 @@ msgid "" "one of the Unicode options in the Encoding drop down list.\n" "Continue?" msgstr "" -"%s\n" +"%1\n" "Diese Datei enthält Unicode-Zeichen, die verloren gehen, wenn\n" -"Sie die Datei mit %s-Zeichenkodierung speichern.\n" +"Sie die Datei mit %2-Zeichenkodierung speichern.\n" "Um die Zeichen beizubehalten, klicken Sie Abbrechen und wählen\n" "Sie eine der Unicode-Optionen in der Liste.\n" "Möchten Sie fortfahren?" @@ -11202,9 +11201,8 @@ msgid "Processes: %d" msgstr "Prozesse: %d" #: taskmgr.rc:267 -#, fuzzy msgid "Mem Usage: %1!u!kB / %2!u!kB" -msgstr "Speicherauslastung: %dK / %dK" +msgstr "Speicherauslastung: %1!u!kB / %2!u!kB" #: taskmgr.rc:272 msgid "Image Name"
1
0
0
0
Jacek Caban : jscript: Use bytecode for '==' and '!=' expression.
by Alexandre Julliard
25 Nov '11
25 Nov '11
Module: wine Branch: master Commit: 58952a07d045cecacd12f222da0be49f8748528b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=58952a07d045cecacd12f222d…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Nov 25 12:07:30 2011 +0100 jscript: Use bytecode for '==' and '!=' expression. --- dlls/jscript/compile.c | 4 +++ dlls/jscript/engine.c | 52 ++++++++++++++++++++++------------------------- dlls/jscript/engine.h | 4 +- dlls/jscript/parser.y | 4 +- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/dlls/jscript/compile.c b/dlls/jscript/compile.c index 17c949b..65d6861 100644 --- a/dlls/jscript/compile.c +++ b/dlls/jscript/compile.c @@ -228,6 +228,8 @@ static HRESULT compile_expression(compiler_ctx_t *ctx, expression_t *expr) return compile_unary_expression(ctx, (unary_expression_t*)expr, OP_bneg); case EXPR_COMMA: return compile_comma_expression(ctx, (binary_expression_t*)expr); + case EXPR_EQ: + return compile_binary_expression(ctx, (binary_expression_t*)expr, OP_eq); case EXPR_EQEQ: return compile_binary_expression(ctx, (binary_expression_t*)expr, OP_eq2); case EXPR_IN: @@ -238,6 +240,8 @@ static HRESULT compile_expression(compiler_ctx_t *ctx, expression_t *expr) return compile_unary_expression(ctx, (unary_expression_t*)expr, OP_neg); case EXPR_MINUS: return compile_unary_expression(ctx, (unary_expression_t*)expr, OP_minus); + case EXPR_NOTEQ: + return compile_binary_expression(ctx, (binary_expression_t*)expr, OP_neq); case EXPR_NOTEQEQ: return compile_binary_expression(ctx, (binary_expression_t*)expr, OP_neq2); case EXPR_PLUS: diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c index c4889f5..9e26e93 100644 --- a/dlls/jscript/engine.c +++ b/dlls/jscript/engine.c @@ -2842,70 +2842,66 @@ static HRESULT equal_values(script_ctx_t *ctx, VARIANT *lval, VARIANT *rval, jse } /* ECMA-262 3rd Edition 11.9.1 */ -HRESULT equal_expression_eval(script_ctx_t *ctx, expression_t *_expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) +HRESULT interp_eq(exec_ctx_t *ctx) { - binary_expression_t *expr = (binary_expression_t*)_expr; - VARIANT rval, lval; + VARIANT *l, *r; BOOL b; HRESULT hres; - TRACE("\n"); + r = stack_pop(ctx); + l = stack_pop(ctx); - hres = get_binary_expr_values(ctx, expr, ei, &rval, &lval); - if(FAILED(hres)) - return hres; + TRACE("%s == %s\n", debugstr_variant(l), debugstr_variant(r)); - hres = equal_values(ctx, &rval, &lval, ei, &b); - VariantClear(&lval); - VariantClear(&rval); + hres = equal_values(ctx->parser->script, l, r, &ctx->ei, &b); + VariantClear(l); + VariantClear(r); if(FAILED(hres)) return hres; - return return_bool(ret, b); + return stack_push_bool(ctx, b); } -/* ECMA-262 3rd Edition 11.9.4 */ -static HRESULT interp_eq2(exec_ctx_t *ctx) +/* ECMA-262 3rd Edition 11.9.2 */ +HRESULT interp_neq(exec_ctx_t *ctx) { VARIANT *l, *r; BOOL b; HRESULT hres; - TRACE("\n"); - r = stack_pop(ctx); l = stack_pop(ctx); - hres = equal2_values(r, l, &b); + TRACE("%s != %s\n", debugstr_variant(l), debugstr_variant(r)); + + hres = equal_values(ctx->parser->script, l, r, &ctx->ei, &b); VariantClear(l); VariantClear(r); if(FAILED(hres)) return hres; - return stack_push_bool(ctx, b); + return stack_push_bool(ctx, !b); } -/* ECMA-262 3rd Edition 11.9.2 */ -HRESULT not_equal_expression_eval(script_ctx_t *ctx, expression_t *_expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) +/* ECMA-262 3rd Edition 11.9.4 */ +static HRESULT interp_eq2(exec_ctx_t *ctx) { - binary_expression_t *expr = (binary_expression_t*)_expr; - VARIANT rval, lval; + VARIANT *l, *r; BOOL b; HRESULT hres; TRACE("\n"); - hres = get_binary_expr_values(ctx, expr, ei, &lval, &rval); - if(FAILED(hres)) - return hres; + r = stack_pop(ctx); + l = stack_pop(ctx); - hres = equal_values(ctx, &lval, &rval, ei, &b); - VariantClear(&lval); - VariantClear(&rval); + hres = equal2_values(r, l, &b); + VariantClear(l); + VariantClear(r); if(FAILED(hres)) return hres; - return return_bool(ret, !b); + return stack_push_bool(ctx, b); } /* ECMA-262 3rd Edition 11.9.5 */ diff --git a/dlls/jscript/engine.h b/dlls/jscript/engine.h index dd31909..d74d57c 100644 --- a/dlls/jscript/engine.h +++ b/dlls/jscript/engine.h @@ -46,11 +46,13 @@ typedef struct _func_stack { X(bool, 1, ARG_INT, 0) \ X(bneg, 1, 0,0) \ X(double, 1, ARG_SBL, 0) \ + X(eq, 1, 0,0) \ X(eq2, 1, 0,0) \ X(in, 1, 0,0) \ X(int, 1, ARG_INT, 0) \ X(minus, 1, 0,0) \ X(neg, 1, 0,0) \ + X(neq, 1, 0,0) \ X(neq2, 1, 0,0) \ X(null, 1, 0,0) \ X(pop, 1, 0,0) \ @@ -553,8 +555,6 @@ HRESULT post_increment_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcep HRESULT post_decrement_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; HRESULT pre_increment_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; HRESULT pre_decrement_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; -HRESULT equal_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; -HRESULT not_equal_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; HRESULT less_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; HRESULT lesseq_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; HRESULT greater_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; diff --git a/dlls/jscript/parser.y b/dlls/jscript/parser.y index 3e7f0fe..3c953eb 100644 --- a/dlls/jscript/parser.y +++ b/dlls/jscript/parser.y @@ -1327,9 +1327,9 @@ static const expression_eval_t expression_eval_table[] = { post_decrement_expression_eval, pre_increment_expression_eval, pre_decrement_expression_eval, - equal_expression_eval, compiled_expression_eval, - not_equal_expression_eval, + compiled_expression_eval, + compiled_expression_eval, compiled_expression_eval, less_expression_eval, lesseq_expression_eval,
1
0
0
0
Jacek Caban : jscript: Use bytecode for unary '-' expression.
by Alexandre Julliard
25 Nov '11
25 Nov '11
Module: wine Branch: master Commit: 413fe9a46200f9477d1b6bf2ba7a55b4f76b0760 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=413fe9a46200f9477d1b6bf2b…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Nov 25 12:06:30 2011 +0100 jscript: Use bytecode for unary '-' expression. --- dlls/jscript/compile.c | 2 ++ dlls/jscript/engine.c | 22 ++++------------------ dlls/jscript/engine.h | 1 + dlls/jscript/parser.y | 2 +- 4 files changed, 8 insertions(+), 19 deletions(-) diff --git a/dlls/jscript/compile.c b/dlls/jscript/compile.c index 12dd04f..17c949b 100644 --- a/dlls/jscript/compile.c +++ b/dlls/jscript/compile.c @@ -236,6 +236,8 @@ static HRESULT compile_expression(compiler_ctx_t *ctx, expression_t *expr) return compile_literal(ctx, ((literal_expression_t*)expr)->literal); case EXPR_LOGNEG: return compile_unary_expression(ctx, (unary_expression_t*)expr, OP_neg); + case EXPR_MINUS: + return compile_unary_expression(ctx, (unary_expression_t*)expr, OP_minus); case EXPR_NOTEQEQ: return compile_binary_expression(ctx, (binary_expression_t*)expr, OP_neq2); case EXPR_PLUS: diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c index a004326..c4889f5 100644 --- a/dlls/jscript/engine.c +++ b/dlls/jscript/engine.c @@ -2574,32 +2574,18 @@ HRESULT typeof_expression_eval(script_ctx_t *ctx, expression_t *_expr, DWORD fla } /* ECMA-262 3rd Edition 11.4.7 */ -HRESULT minus_expression_eval(script_ctx_t *ctx, expression_t *_expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) +HRESULT interp_minus(exec_ctx_t *ctx) { - unary_expression_t *expr = (unary_expression_t*)_expr; - exprval_t exprval; - VARIANT val, num; + VARIANT n; HRESULT hres; TRACE("\n"); - hres = expr_eval(ctx, expr->expression, 0, ei, &exprval); + hres = stack_pop_number(ctx, &n); if(FAILED(hres)) return hres; - hres = exprval_to_value(ctx, &exprval, ei, &val); - exprval_release(&exprval); - if(FAILED(hres)) - return hres; - - hres = to_number(ctx, &val, ei, &num); - VariantClear(&val); - if(FAILED(hres)) - return hres; - - ret->type = EXPRVAL_VARIANT; - num_set_val(&ret->u.var, -num_val(&num)); - return S_OK; + return stack_push_number(ctx, -num_val(&n)); } /* ECMA-262 3rd Edition 11.4.6 */ diff --git a/dlls/jscript/engine.h b/dlls/jscript/engine.h index 736fe5a..dd31909 100644 --- a/dlls/jscript/engine.h +++ b/dlls/jscript/engine.h @@ -49,6 +49,7 @@ typedef struct _func_stack { X(eq2, 1, 0,0) \ X(in, 1, 0,0) \ X(int, 1, ARG_INT, 0) \ + X(minus, 1, 0,0) \ X(neg, 1, 0,0) \ X(neq2, 1, 0,0) \ X(null, 1, 0,0) \ diff --git a/dlls/jscript/parser.y b/dlls/jscript/parser.y index 2e8c0d8..3e7f0fe 100644 --- a/dlls/jscript/parser.y +++ b/dlls/jscript/parser.y @@ -1321,7 +1321,7 @@ static const expression_eval_t expression_eval_table[] = { delete_expression_eval, compiled_expression_eval, typeof_expression_eval, - minus_expression_eval, + compiled_expression_eval, compiled_expression_eval, post_increment_expression_eval, post_decrement_expression_eval,
1
0
0
0
Jacek Caban : jscript: Use bytecode for '-' expression implementation.
by Alexandre Julliard
25 Nov '11
25 Nov '11
Module: wine Branch: master Commit: b13c6a27c3113e898989063416512a35b56831e6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b13c6a27c3113e89898906341…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Nov 25 12:06:05 2011 +0100 jscript: Use bytecode for '-' expression implementation. --- dlls/jscript/compile.c | 2 ++ dlls/jscript/engine.c | 34 +++++++++++++++++++++++++++++++--- dlls/jscript/engine.h | 2 +- dlls/jscript/parser.y | 2 +- 4 files changed, 35 insertions(+), 5 deletions(-) diff --git a/dlls/jscript/compile.c b/dlls/jscript/compile.c index 77391bd..12dd04f 100644 --- a/dlls/jscript/compile.c +++ b/dlls/jscript/compile.c @@ -240,6 +240,8 @@ static HRESULT compile_expression(compiler_ctx_t *ctx, expression_t *expr) return compile_binary_expression(ctx, (binary_expression_t*)expr, OP_neq2); case EXPR_PLUS: return compile_unary_expression(ctx, (unary_expression_t*)expr, OP_tonum); + case EXPR_SUB: + return compile_binary_expression(ctx, (binary_expression_t*)expr, OP_sub); case EXPR_THIS: return push_instr(ctx, OP_this) == -1 ? E_OUTOFMEMORY : S_OK; case EXPR_VOID: diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c index 87f873c..a004326 100644 --- a/dlls/jscript/engine.c +++ b/dlls/jscript/engine.c @@ -86,6 +86,14 @@ static HRESULT stack_push_bool(exec_ctx_t *ctx, BOOL b) return stack_push(ctx, &v); } +static inline HRESULT stack_push_number(exec_ctx_t *ctx, double number) +{ + VARIANT v; + + num_set_val(&v, number); + return stack_push(ctx, &v); +} + static inline VARIANT *stack_pop(exec_ctx_t *ctx) { assert(ctx->top); @@ -98,6 +106,17 @@ static void stack_popn(exec_ctx_t *ctx, unsigned n) VariantClear(stack_pop(ctx)); } +static HRESULT stack_pop_number(exec_ctx_t *ctx, VARIANT *r) +{ + VARIANT *v; + HRESULT hres; + + v = stack_pop(ctx); + hres = to_number(ctx->parser->script, v, &ctx->ei, r); + VariantClear(v); + return hres; +} + static void exprval_release(exprval_t *val) { switch(val->type) { @@ -2297,13 +2316,22 @@ static HRESULT sub_eval(script_ctx_t *ctx, VARIANT *lval, VARIANT *rval, jsexcep } /* ECMA-262 3rd Edition 11.6.2 */ -HRESULT sub_expression_eval(script_ctx_t *ctx, expression_t *_expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) +HRESULT interp_sub(exec_ctx_t *ctx) { - binary_expression_t *expr = (binary_expression_t*)_expr; + VARIANT l, r; + HRESULT hres; TRACE("\n"); - return binary_expr_eval(ctx, expr, sub_eval, ei, ret); + hres = stack_pop_number(ctx, &r); + if(FAILED(hres)) + return hres; + + hres = stack_pop_number(ctx, &l); + if(FAILED(hres)) + return hres; + + return stack_push_number(ctx, num_val(&l)-num_val(&r)); } /* ECMA-262 3rd Edition 11.5.1 */ diff --git a/dlls/jscript/engine.h b/dlls/jscript/engine.h index a713e02..736fe5a 100644 --- a/dlls/jscript/engine.h +++ b/dlls/jscript/engine.h @@ -59,6 +59,7 @@ typedef struct _func_stack { X(tonum, 1, 0,0) \ X(tree, 1, ARG_EXPR, 0) \ X(ret, 0, 0,0) \ + X(sub, 1, 0,0) \ X(void, 1, 0,0) typedef enum { @@ -541,7 +542,6 @@ HRESULT binary_or_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*, HRESULT binary_xor_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; HRESULT binary_and_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; HRESULT instanceof_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; -HRESULT sub_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; HRESULT mul_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; HRESULT div_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; HRESULT mod_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; diff --git a/dlls/jscript/parser.y b/dlls/jscript/parser.y index d8daa59..2e8c0d8 100644 --- a/dlls/jscript/parser.y +++ b/dlls/jscript/parser.y @@ -1314,7 +1314,7 @@ static const expression_eval_t expression_eval_table[] = { instanceof_expression_eval, compiled_expression_eval, compiled_expression_eval, - sub_expression_eval, + compiled_expression_eval, mul_expression_eval, div_expression_eval, mod_expression_eval,
1
0
0
0
Jacek Caban : jscript: Use bytecode for comma expression implementation.
by Alexandre Julliard
25 Nov '11
25 Nov '11
Module: wine Branch: master Commit: 47314a92d7c1d46739108ba21994ea3c2abba9af URL:
http://source.winehq.org/git/wine.git/?a=commit;h=47314a92d7c1d46739108ba21…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Nov 25 12:05:50 2011 +0100 jscript: Use bytecode for comma expression implementation. --- dlls/jscript/compile.c | 17 +++++++++++++++++ dlls/jscript/engine.c | 28 ++++++++-------------------- dlls/jscript/engine.h | 2 +- dlls/jscript/parser.y | 2 +- 4 files changed, 27 insertions(+), 22 deletions(-) diff --git a/dlls/jscript/compile.c b/dlls/jscript/compile.c index 4b5b91b..77391bd 100644 --- a/dlls/jscript/compile.c +++ b/dlls/jscript/compile.c @@ -156,6 +156,21 @@ static HRESULT compile_unary_expression(compiler_ctx_t *ctx, unary_expression_t return push_instr(ctx, op) == -1 ? E_OUTOFMEMORY : S_OK; } +/* ECMA-262 3rd Edition 11.14 */ +static HRESULT compile_comma_expression(compiler_ctx_t *ctx, binary_expression_t *expr) +{ + HRESULT hres; + + hres = compile_expression(ctx, expr->expression1); + if(FAILED(hres)) + return hres; + + if(push_instr(ctx, OP_pop) == -1) + return E_OUTOFMEMORY; + + return compile_expression(ctx, expr->expression2); +} + static HRESULT compile_interp_fallback(compiler_ctx_t *ctx, expression_t *expr) { unsigned instr; @@ -211,6 +226,8 @@ static HRESULT compile_expression(compiler_ctx_t *ctx, expression_t *expr) return compile_binary_expression(ctx, (binary_expression_t*)expr, OP_add); case EXPR_BITNEG: return compile_unary_expression(ctx, (unary_expression_t*)expr, OP_bneg); + case EXPR_COMMA: + return compile_comma_expression(ctx, (binary_expression_t*)expr); case EXPR_EQEQ: return compile_binary_expression(ctx, (binary_expression_t*)expr, OP_eq2); case EXPR_IN: diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c index e706407..87f873c 100644 --- a/dlls/jscript/engine.c +++ b/dlls/jscript/engine.c @@ -1910,26 +1910,6 @@ HRESULT property_value_expression_eval(script_ctx_t *ctx, expression_t *_expr, D return S_OK; } -/* ECMA-262 3rd Edition 11.14 */ -HRESULT comma_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; - VARIANT lval, rval; - HRESULT hres; - - TRACE("\n"); - - hres = get_binary_expr_values(ctx, expr, ei, &lval, &rval); - if(FAILED(hres)) - return hres; - - VariantClear(&lval); - - ret->type = EXPRVAL_VARIANT; - ret->u.var = rval; - return S_OK; -} - /* ECMA-262 3rd Edition 11.11 */ HRESULT logical_or_expression_eval(script_ctx_t *ctx, expression_t *_expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) { @@ -3342,6 +3322,14 @@ HRESULT assign_xor_expression_eval(script_ctx_t *ctx, expression_t *_expr, DWORD return assign_oper_eval(ctx, expr->expression1, expr->expression2, xor_eval, ei, ret); } +static HRESULT interp_pop(exec_ctx_t *ctx) +{ + TRACE("\n"); + + stack_popn(ctx, 1); + return S_OK; +} + static HRESULT interp_ret(exec_ctx_t *ctx) { TRACE("\n"); diff --git a/dlls/jscript/engine.h b/dlls/jscript/engine.h index c42b2e8..a713e02 100644 --- a/dlls/jscript/engine.h +++ b/dlls/jscript/engine.h @@ -52,6 +52,7 @@ typedef struct _func_stack { X(neg, 1, 0,0) \ X(neq2, 1, 0,0) \ X(null, 1, 0,0) \ + X(pop, 1, 0,0) \ X(regexp, 1, ARG_STR, ARG_INT) \ X(str, 1, ARG_STR, 0) \ X(this, 1, 0,0) \ @@ -534,7 +535,6 @@ HRESULT identifier_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t* HRESULT array_literal_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; HRESULT property_value_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; -HRESULT comma_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; HRESULT logical_or_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; HRESULT logical_and_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; HRESULT binary_or_expression_eval(script_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*) DECLSPEC_HIDDEN; diff --git a/dlls/jscript/parser.y b/dlls/jscript/parser.y index f051c0c..d8daa59 100644 --- a/dlls/jscript/parser.y +++ b/dlls/jscript/parser.y @@ -1305,7 +1305,7 @@ static expression_t *new_function_expression(parser_ctx_t *ctx, const WCHAR *ide } static const expression_eval_t expression_eval_table[] = { - comma_expression_eval, + compiled_expression_eval, logical_or_expression_eval, logical_and_expression_eval, binary_or_expression_eval,
1
0
0
0
Jacek Caban : jscript: Fixed memory leaks.
by Alexandre Julliard
25 Nov '11
25 Nov '11
Module: wine Branch: master Commit: 172fa4fa99873bb1a98e658c3cdba950044f0eb9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=172fa4fa99873bb1a98e658c3…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Nov 25 12:05:31 2011 +0100 jscript: Fixed memory leaks. Spotted by Piotr. --- dlls/jscript/engine.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c index 3d9858d..e706407 100644 --- a/dlls/jscript/engine.c +++ b/dlls/jscript/engine.c @@ -2290,6 +2290,8 @@ HRESULT interp_add(exec_ctx_t *ctx) TRACE("%s + %s\n", debugstr_variant(l), debugstr_variant(r)); hres = add_eval(ctx->parser->script, l, r, &ctx->ei, &ret); + VariantClear(l); + VariantClear(r); if(FAILED(hres)) return hres; @@ -3362,6 +3364,7 @@ static HRESULT interp_tree(exec_ctx_t *ctx) return hres; hres = exprval_to_value(ctx->parser->script, &val, &ctx->ei, &v); + exprval_release(&val); if(FAILED(hres)) return hres;
1
0
0
0
Piotr Caban : msvcp90: Added runtime_exception implementation.
by Alexandre Julliard
25 Nov '11
25 Nov '11
Module: wine Branch: master Commit: 400c887e857e86f3155c293a2d0293479b527c3d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=400c887e857e86f3155c293a2…
Author: Piotr Caban <piotr(a)codeweavers.com> Date: Fri Nov 25 10:46:48 2011 +0100 msvcp90: Added runtime_exception implementation. --- dlls/msvcp90/exception.c | 136 ++++++++++++++++++++++++++++++++++++++++++++-- dlls/msvcp90/msvcp90.h | 3 +- 2 files changed, 134 insertions(+), 5 deletions(-) diff --git a/dlls/msvcp90/exception.c b/dlls/msvcp90/exception.c index 77e1e60..0008f43 100644 --- a/dlls/msvcp90/exception.c +++ b/dlls/msvcp90/exception.c @@ -77,6 +77,7 @@ extern const vtable_ptr MSVCP_logic_error_vtable; extern const vtable_ptr MSVCP_length_error_vtable; extern const vtable_ptr MSVCP_out_of_range_vtable; extern const vtable_ptr MSVCP_invalid_argument_vtable; +extern const vtable_ptr MSVCP_runtime_error_vtable; /* exception class data */ static type_info exception_type_info = { @@ -677,6 +678,131 @@ static const cxx_exception_type invalid_argument_cxx_type = { &invalid_argument_cxx_type_table }; +/* runtime_error class data */ +typedef struct { + exception e; + basic_string_char str; +} runtime_error; + +DEFINE_THISCALL_WRAPPER(MSVCP_runtime_error_ctor, 8) +runtime_error* __thiscall MSVCP_runtime_error_ctor( + runtime_error *this, const char **name) +{ + TRACE("%p %s\n", this, *name); + this->e.vtable = &MSVCP_runtime_error_vtable; + this->e.name = NULL; + this->e.do_free = FALSE; + MSVCP_basic_string_char_ctor_cstr(&this->str, *name); + return this; +} + +DEFINE_THISCALL_WRAPPER(MSVCP_runtime_error_copy_ctor, 8) +runtime_error* __thiscall MSVCP_runtime_error_copy_ctor( + runtime_error *this, runtime_error *rhs) +{ + TRACE("%p %p\n", this, rhs); + MSVCP_exception_copy_ctor(&this->e, &rhs->e); + MSVCP_basic_string_char_copy_ctor(&this->str, &rhs->str); + this->e.vtable = &MSVCP_runtime_error_vtable; + return this; +} + +DEFINE_THISCALL_WRAPPER(MSVCP_runtime_error_dtor, 4) +void __thiscall MSVCP_runtime_error_dtor(runtime_error *this) +{ + TRACE("%p\n", this); + MSVCP_exception_dtor(&this->e); + MSVCP_basic_string_char_dtor(&this->str); +} + +DEFINE_THISCALL_WRAPPER(MSVCP_runtime_error_vector_dtor, 8) +void* __thiscall MSVCP_runtime_error_vector_dtor( + runtime_error *this, unsigned int flags) +{ + TRACE("%p %x\n", this, flags); + if(flags & 2) { + /* we have an array, with the number of elements stored before the first object */ + int i, *ptr = (int *)this-1; + + for(i=*ptr-1; i>=0; i--) + MSVCP_runtime_error_dtor(this+i); + MSVCRT_operator_delete(ptr); + } else { + MSVCP_runtime_error_dtor(this); + if(flags & 1) + MSVCRT_operator_delete(this); + } + + return this; +} + +static const type_info runtime_error_type_info = { + &MSVCP_runtime_error_vtable, + NULL, + ".?AVruntime_error@std@@" +}; + +static const rtti_base_descriptor runtime_error_rtti_base_descriptor = { + &runtime_error_type_info, + 1, + { 0, -1, 0 }, + 64 +}; + +static const rtti_base_array runtime_error_rtti_base_array = { + { + &runtime_error_rtti_base_descriptor, + &exception_rtti_base_descriptor, + NULL + } +}; + +static const rtti_object_hierarchy runtime_error_type_hierarchy = { + 0, + 0, + 2, + &runtime_error_rtti_base_array +}; + +const rtti_object_locator runtime_error_rtti = { + 0, + 0, + 0, + &runtime_error_type_info, + &runtime_error_type_hierarchy +}; + +static const cxx_type_info runtime_error_cxx_type_info = { + 0, + &runtime_error_type_info, + { 0, -1, 0 }, + sizeof(runtime_error), + (cxx_copy_ctor)THISCALL(MSVCP_runtime_error_copy_ctor) +}; + +static const cxx_type_info_table runtime_error_cxx_type_table = { + 2, + { + &runtime_error_cxx_type_info, + &exception_cxx_type_info, + NULL + } +}; + +static const cxx_exception_type runtime_error_cxx_type = { + 0, + (cxx_copy_ctor)THISCALL(MSVCP_runtime_error_dtor), + NULL, + &runtime_error_cxx_type_table +}; + +DEFINE_THISCALL_WRAPPER(MSVCP_runtime_error_what, 4) +const char* __thiscall MSVCP_runtime_error_what(runtime_error *this) +{ + TRACE("%p\n", this); + return MSVCP_basic_string_char_c_str(&this->str); +} + #ifndef __GNUC__ void __asm_dummy_vtables(void) { #endif @@ -685,6 +811,7 @@ void __asm_dummy_vtables(void) { __ASM_EXCEPTION_VTABLE(length_error, MSVCP_logic_error_what); __ASM_EXCEPTION_VTABLE(out_of_range, MSVCP_logic_error_what); __ASM_EXCEPTION_VTABLE(invalid_argument, MSVCP_logic_error_what); + __ASM_EXCEPTION_VTABLE(runtime_error, MSVCP_runtime_error_what); #ifndef __GNUC__ } #endif @@ -699,25 +826,21 @@ void throw_exception(exception_type et, const char *str) exception e; MSVCP_exception_ctor(&e, &addr); _CxxThrowException(&e, &exception_cxx_type); - return; } case EXCEPTION_BAD_ALLOC: { bad_alloc e; MSVCP_bad_alloc_ctor(&e, &addr); _CxxThrowException(&e, &bad_alloc_cxx_type); - return; } case EXCEPTION_LOGIC_ERROR: { logic_error e; MSVCP_logic_error_ctor(&e, &addr); _CxxThrowException((exception*)&e, &logic_error_cxx_type); - return; } case EXCEPTION_LENGTH_ERROR: { length_error e; MSVCP_length_error_ctor(&e, &addr); _CxxThrowException((exception*)&e, &length_error_cxx_type); - return; } case EXCEPTION_OUT_OF_RANGE: { out_of_range e; @@ -729,5 +852,10 @@ void throw_exception(exception_type et, const char *str) MSVCP_invalid_argument_ctor(&e, &addr); _CxxThrowException((exception*)&e, &invalid_argument_cxx_type); } + case EXCEPTION_RUNTIME_ERROR: { + runtime_error e; + MSVCP_runtime_error_ctor(&e, &addr); + _CxxThrowException((exception*)&e, &runtime_error_cxx_type); + } } } diff --git a/dlls/msvcp90/msvcp90.h b/dlls/msvcp90/msvcp90.h index cb2a9b8..72e5d11 100644 --- a/dlls/msvcp90/msvcp90.h +++ b/dlls/msvcp90/msvcp90.h @@ -104,7 +104,8 @@ typedef enum __exception_type { EXCEPTION_LOGIC_ERROR, EXCEPTION_LENGTH_ERROR, EXCEPTION_OUT_OF_RANGE, - EXCEPTION_INVALID_ARGUMENT + EXCEPTION_INVALID_ARGUMENT, + EXCEPTION_RUNTIME_ERROR } exception_type; void throw_exception(exception_type, const char *); void set_exception_vtable(void);
1
0
0
0
← Newer
1
...
10
11
12
13
14
15
16
...
86
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
82
83
84
85
86
Results per page:
10
25
50
100
200