From owner-freebsd-hackers Fri May 9 21:52:11 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id VAA17578 for hackers-outgoing; Fri, 9 May 1997 21:52:11 -0700 (PDT) Received: from sax.sax.de (sax.sax.de [193.175.26.33]) by hub.freebsd.org (8.8.5/8.8.5) with SMTP id VAA17563 for ; Fri, 9 May 1997 21:52:07 -0700 (PDT) Received: (from uucp@localhost) by sax.sax.de (8.6.12/8.6.12-s1) with UUCP id GAA00468 for freebsd-hackers@FreeBSD.ORG; Sat, 10 May 1997 06:52:05 +0200 Received: (from j@localhost) by uriah.heep.sax.de (8.8.5/8.8.5) id GAA09049; Sat, 10 May 1997 06:33:49 +0200 (MET DST) Message-ID: <19970510063349.ZO50925@uriah.heep.sax.de> Date: Sat, 10 May 1997 06:33:49 +0200 From: j@uriah.heep.sax.de (J Wunsch) To: freebsd-hackers@FreeBSD.ORG (FreeBSD hackers) Subject: Re: g++ shared library segfaults References: <19970509214357.SQ03572@uriah.heep.sax.de> <199705092251.PAA05670@rah.star-gate.com> X-Mailer: Mutt 0.60_p2-3,5,8-9 Mime-Version: 1.0 X-Phone: +49-351-2012 669 X-PGP-Fingerprint: DC 47 E6 E4 FF A6 E9 8F 93 21 E0 7D F9 12 D6 4E Reply-To: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch) In-Reply-To: <199705092251.PAA05670@rah.star-gate.com>; from Amancio Hasty on May 9, 1997 15:51:51 -0700 Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk As Amancio Hasty wrote: > I traced it further more and it looks like a bug in Docviewer.c using > an illegal reference to a local variable. > > for (long i = 0; i < count; ++i) { > ViewerColorInfo& info = _color_info->item_ref(i); > if (strcmp(info._name, name) == 0) { > break; > } > } > > later on it checks the value of i. That's not illegal. The scope of i is inside the current block (at the same level where the stuff is you've been quoting), from the line with the `for' loop, to the end of that block. -- cheers, J"org joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE Never trust an operating system you don't have sources for. ;-)