From owner-freebsd-hackers Fri May 9 23:35:45 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id XAA22759 for hackers-outgoing; Fri, 9 May 1997 23:35:45 -0700 (PDT) Received: from rah.star-gate.com (rah.star-gate.com [204.188.121.18]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id XAA22754 for ; Fri, 9 May 1997 23:35:43 -0700 (PDT) Received: from rah.star-gate.com (localhost.star-gate.com [127.0.0.1]) by rah.star-gate.com (8.8.5/8.8.5) with ESMTP id XAA01088 for ; Fri, 9 May 1997 23:35:43 -0700 (PDT) Message-Id: <199705100635.XAA01088@rah.star-gate.com> X-Mailer: exmh version 1.6.9 8/22/96 to: freebsd-hackers@FreeBSD.ORG (FreeBSD hackers) Subject: Re: g++ shared library segfaults In-reply-to: Your message of "Sat, 10 May 1997 06:33:49 +0200." <19970510063349.ZO50925@uriah.heep.sax.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 09 May 1997 23:35:42 -0700 From: Amancio Hasty Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk You are right thats not illegal . Care to try out doc to find out whats wrong ? 8) Hint: { for (long i = 0....) { // first definition of "i" } var.ref(i) } Regards, Amancio >From The Desk Of J Wunsch : > 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. ;-)