Re: Java_java_lang_VMClass_getDeclaredFields question

"Grzegorz B. Prokopski" <[email protected]> Tue, 18 Jan 2005 23:58:52 -0500
Newsgroups gmane.comp.java.vm.sablevm.devel
Message-ID <[email protected]>
On Tue, 2005-18-01 at 23:25 -0500, Chris Pickett wrote:
> Hi,
> 
> In Java_java_lang_VMClass_getDeclaredFields, how come at label "end:", 
> if you fail to exit the monitor, you return from the function without 
> any errors?

If the lock you took via enter_object_monitor at the beginning was
taken, then the monitor_acquired is set to true, so the
exit_object_monitor should never fail, unless there's a serious
problem within the JVM itself.

I think that instead of goto: end; (which is the same as if we just
continued, because monitor_acquired was set to false alread) in case
of failure on unlock we should have fatal_error("impossible control
flow"); or "internal error" or sth. similar.

Good catch, Chris.  This is how I see it, at least.

Have I missed anything?

				GBP
-- 
Grzegorz B. Prokopski           <[email protected]>
SableVM - Free, LGPL'ed Java VM  http://sablevm.org
Why SableVM ?!?                  http://sablevm.org/wiki/Features
Debian GNU/Linux - the Free OS   http://www.debian.org