Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!YAHI.STANFORD.EDU!tiemann From: tiemann@YAHI.STANFORD.EDU (Michael Tiemann) Newsgroups: gnu.g++.bug Subject: g++1.35 evaluates expression twice when destructor is virtual Message-ID: <8908010244.AA02549@yahi.Stanford.EDU> Date: 1 Aug 89 02:44:04 GMT References: <465@tnosoes.UUCP> Sender: daemon@tut.cis.ohio-state.edu Reply-To: tiemann@lurch.stanford.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 20 G++ evaluates the expression b.delfunc(this) twice. Discovered when porting ET++ [...] Here is the fix (to function build_delete, near the top of the function): *** cplus-init.c~ Fri Jul 28 14:56:18 1989 --- cplus-init.c Mon Jul 31 19:39:05 1989 *************** *** 2704,2707 **** --- 2704,2709 ---- return expr; } + if (TREE_VOLATILE (addr)) + addr = save_expr (addr); ref = build_indirect_ref (addr, 0); ptr = 1; yahi% Michael