From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Brownell To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org Subject: Re: java/3426: java.io.InputStreamReader, infinite loop Date: Wed, 04 Jul 2001 23:46:00 -0000 Message-id: <20010705064601.31922.qmail@sourceware.cygnus.com> X-SW-Source: 2001-07/msg00109.html List-Id: The following reply was made to PR libgcj/3426; it has been noted by GNATS. From: David Brownell To: tromey@redhat.com Cc: gcc-gnats@gcc.gnu.org Subject: Re: java/3426: java.io.InputStreamReader, infinite loop Date: Wed, 04 Jul 2001 23:44:42 -0700 > David> "FIXME: what if R == -1 ?" comment which seems like it > David> is what's being hit here. > > We definitely have to do something smarter if we hit an encoding > error. Maybe throwing CharConversionException is appropriate? That'd be "r = -1" and "errno != EINVAL" ... EINVAL is the "not enough characters" case (not an "error"), the other documented cases would be real errors. > We currently don't throw that anywhere, which seems odd. > I think we ought to throw it if we detect garbage in the input > stream. What do you think? Yes. See the updated patch I'm sending in my next message. - Dave