[ROOT] CINT: extra destructor called

From: Christoph Bugel (chris@tti-telecom.com)
Date: Mon Aug 06 2001 - 15:02:58 MEST


Hi!
I found a bug in cint, causing it to call a destructor where it
shouldnt.  For example, the code below will produce this output:

DTOR
CTOR
DTOR

This was tested with cint-5.15.07.
BTW, when 'i' is initialized to 3, the output will be 'DTOR' which is
also wrong. If 'i' is initialized to 0 it works ok. (CTOR, DTOR).
Thanks!

here is the code:

/////////////////////////////////////

class X
{
	public:
	X(){ printf("CTOR\n"); }
	~X(){ printf("DTOR\n"); }
};
void bug()
{ 
	int i=0;
	while(i<5)
	{
		if(i==1)
		{
			X x1;
		}
		i = i + 1;
	}
}



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:56 MET