Commit 5bb77b4e authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msvcp90: Don't overwrite pointers to class members in basic_streambuf:swap.

parent 29a55bc4
...@@ -2002,18 +2002,33 @@ streamsize __thiscall basic_streambuf_char_sputn(basic_streambuf_char *this, con ...@@ -2002,18 +2002,33 @@ streamsize __thiscall basic_streambuf_char_sputn(basic_streambuf_char *this, con
DEFINE_THISCALL_WRAPPER(basic_streambuf_char_swap, 8) DEFINE_THISCALL_WRAPPER(basic_streambuf_char_swap, 8)
void __thiscall basic_streambuf_char_swap(basic_streambuf_char *this, basic_streambuf_char *r) void __thiscall basic_streambuf_char_swap(basic_streambuf_char *this, basic_streambuf_char *r)
{ {
basic_streambuf_char tmp; char *wfirst, *wnext, *wlast, *rfirst, *rnext, *rlast;
#if _MSVCP_VER < 70
locale loc;
#else
locale *loc;
#endif
TRACE("(%p %p)\n", this, r); TRACE("(%p %p)\n", this, r);
if(this == r) if(this == r)
return; return;
tmp = *this; wfirst = *this->pwbuf;
*this = *r; wnext = *this->pwpos;
this->vtable = tmp.vtable; wlast = *this->pwpos + *this->pwsize;
tmp.vtable = r->vtable; rfirst = *this->prbuf;
*r = tmp; rnext = *this->prpos;
rlast = *this->prpos + *this->prsize;
loc = this->loc;
basic_streambuf_char_setp_next(this, *r->pwbuf, *r->pwpos, *r->pwpos + *r->pwsize);
basic_streambuf_char_setg(this, *r->prbuf, *r->prpos, *r->prpos + *r->prsize);
this->loc = r->loc;
basic_streambuf_char_setp_next(r, wfirst, wnext, wlast);
basic_streambuf_char_setg(r, rfirst, rnext, rlast);
r->loc = loc;
} }
/* ?setp@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXPA_W00@Z */ /* ?setp@?$basic_streambuf@_WU?$char_traits@_W@std@@@std@@IAEXPA_W00@Z */
...@@ -2959,18 +2974,33 @@ streamsize __thiscall basic_streambuf_wchar_sputn(basic_streambuf_wchar *this, c ...@@ -2959,18 +2974,33 @@ streamsize __thiscall basic_streambuf_wchar_sputn(basic_streambuf_wchar *this, c
DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_swap, 8) DEFINE_THISCALL_WRAPPER(basic_streambuf_wchar_swap, 8)
void __thiscall basic_streambuf_wchar_swap(basic_streambuf_wchar *this, basic_streambuf_wchar *r) void __thiscall basic_streambuf_wchar_swap(basic_streambuf_wchar *this, basic_streambuf_wchar *r)
{ {
basic_streambuf_wchar tmp; wchar_t *wfirst, *wnext, *wlast, *rfirst, *rnext, *rlast;
#if _MSVCP_VER < 70
locale loc;
#else
locale *loc;
#endif
TRACE("(%p %p)\n", this, r); TRACE("(%p %p)\n", this, r);
if(this == r) if(this == r)
return; return;
tmp = *this; wfirst = *this->pwbuf;
*this = *r; wnext = *this->pwpos;
this->vtable = tmp.vtable; wlast = *this->pwpos + *this->pwsize;
tmp.vtable = r->vtable; rfirst = *this->prbuf;
*r = tmp; rnext = *this->prpos;
rlast = *this->prpos + *this->prsize;
loc = this->loc;
basic_streambuf_wchar_setp_next(this, *r->pwbuf, *r->pwpos, *r->pwpos + *r->pwsize);
basic_streambuf_wchar_setg(this, *r->prbuf, *r->prpos, *r->prpos + *r->prsize);
this->loc = r->loc;
basic_streambuf_wchar_setp_next(r, wfirst, wnext, wlast);
basic_streambuf_wchar_setg(r, rfirst, rnext, rlast);
r->loc = loc;
} }
/* ?_Stinit@?1??_Init@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IAEXPAU_iobuf@@W4_Initfl@23@@Z@4HA */ /* ?_Stinit@?1??_Init@?$basic_filebuf@DU?$char_traits@D@std@@@std@@IAEXPAU_iobuf@@W4_Initfl@23@@Z@4HA */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment