This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [patch] Java definite assignment


Fergus Henderson <fjh@cs.mu.oz.au> writes:

> >       String x; try { x = new String (); } finally {} x.toString ();
> 
> Surely it *should* issue an error message in that case.
> If `new String ()' throws an exception (e.g. because we're
> out of memory), then `x' will never get explicitly initialized.

But the x.toString() will never get executed either, so it doesn't
matter.  I.e. we will never execute code that accesses x without
x having been assigned first.
-- 
	--Per Bothner
per@bothner.com   http://www.bothner.com/~per/

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]