Hello Christoph,
Thank you for reporting this problem.
It turned out that this is a tricky one. I need time to
think about this. Meanwhile, a workaround is to use optimization
level 0 '.O0' to turn off bytecode compilation.
Thank you
Masaharu Goto
>Date: Mon, 6 Aug 2001 16:02:58 +0300
>From: Christoph Bugel <chris@tti-telecom.com>
>To: roottalk@pcroot.cern.ch, rootdev@pcroot.cern.ch
>Subject: CINT: extra destructor called
>
>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