January 05, 2003
Walter,

The 8.32 beta 15 does no longer crash when I tried the exception tests on my Windows XP.  However, the results are not what expected.  The detailed is as follows:

case 3a.  I have to press Ctrl-C to exit program.
case 3b-3f the memory still leaks.
case 4a-4f the memory still leaks.

These cases are the ones I sent you before.

Thanks,
Steve


January 06, 2003
On Sun, 5 Jan 2003 07:20:13 +0000 (UTC), Steve wrote:
> The 8.32 beta 15 does no longer crash when I tried the exception tests on my Windows XP.  However, the results are not what expected.  The detailed is as follows:
> 
> case 3a.  I have to press Ctrl-C to exit program.
> case 3b-3f the memory still leaks.
> case 4a-4f the memory still leaks.

A simple fix seems to be to use the same trick in core\vecnew.cpp (__vec_delete and __vec_dtor) as core\except.cpp does when calling a destructor (saving SP before calling the destructor and restoring it afterwards):

               __asm mov spsave,sp
#if STDCALL
               _ECX = (long)Parray + Nelem * Sizelem;
               (*(dtor_t)Dtor)(DTORmostderived);
#else
               (*(dtor_t)Dtor)(DTORmostderived,(char *)Parray +
	                                       Nelem * Sizelem);
#endif
               __asm mov sp,spsave


And DMC doesn't pass a pointer to a destructor to __vec_new:

struct A
{
  A()
  { }
  ~A()
  { }
};


int main()
{
  new A[10];
}


generated code:
                push    0  <-- this should be the address of a destructor
                push    offset FLAT:??0A@@QAE@XZ
                push    0Ah
                push    1
                push    0
                call    near ptr ?__vec_new@@YAPAXPAXIHP6CPAXXZP6CHXZ@Z


And one more: core\except.cpp (line 1225 and line 1242) uses _cppeh_sv.dtor_nest. Shouldn't that be _getthreaddata()->t_cppeh_sv.dtor_nest if compiled with -D_MT and _cppeh_sv.dtor_nest only in the single-threaded case?


bye, Christof

-- 
http://cmeerw.org                                 JID: cmeerw@jabber.at mailto cmeerw at web.de

...and what have you contributed to the Net?