public inbox for frysk@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Cagney <cagney@redhat.com>
To: Mark Wielaard <mark@klomp.org>
Cc: frysk <frysk@sources.redhat.com>
Subject: Re: inner classes with fields names similar to outer class/method  	fields
Date: Tue, 03 Jul 2007 15:34:00 -0000	[thread overview]
Message-ID: <468A6C78.9050307@redhat.com> (raw)
In-Reply-To: <1183379510.3622.17.camel@dijkstra.wildebeest.org>

Mark Wielaard wrote:
> Hi,
>
> The following bug cost me a while to track down. The fix is easy. But if
> you are not expecting this then you might be puzzled about it for a long
> time like I was.
>
> testSyscallRunning(frysk.proc.TestSyscallRunning)java.lang.NullPointerException
>    at frysk.proc.TestSyscallRunning$2.execute(TestRunner)
>
> The problem was that under some versions of the fc6 compiler this method
> was miscompiled (!), under f7 the compiler gets it right. The anonymous
> inner class that extends TaskEvent tries to refer to the final task
> field of the method it is in. But TaskEvent has a field called task
> itself. The TaskEvent.task field is never initialized and so stays null.
> By explicitly renaming the final field in the outer method and using
> that name in the inner class the reference is always correct (under
> either the fc6 or f7 compiler).
>   
Mark,

Can you be more specific?  Frysk's build system already has a check for 
what sounds like a very similar bug vis:

class foo {
{
   func1() {
     class Bar {}
  }
  func2() {
    class Bar {}
  }
}


Andrew

  reply	other threads:[~2007-07-03 15:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-02 12:32 Mark Wielaard
2007-07-03 15:34 ` Andrew Cagney [this message]
2007-07-03 17:27   ` Mark Wielaard
2007-07-03 18:44     ` Andrew Cagney
2007-07-03 19:21       ` Mark Wielaard
2007-07-05 18:43 ` Andrew Cagney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=468A6C78.9050307@redhat.com \
    --to=cagney@redhat.com \
    --cc=frysk@sources.redhat.com \
    --cc=mark@klomp.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).