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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC/JVMTI] GetMethodDeclaringClass


Keith Seitz writes:
 > Andrew Haley wrote:
 > 
 > > AFAICS we just need to make sure that all methods for interpreted
 > > classes are pushed with _Jv_PushClass.  Then to get your class,
 > > 
 > >  class = ncodeMap->get (jmethodID->ncode);
 > 
 > I thought about doing that at one time, but I was (too?) worried about 
 > an invalid jmethodID wreaking havoc.

You want to know if a jmethodID really is valid?  That it really is a
pointer to a _Jv_Method?  

 > Is there a way to guard against something like this or otherwise
 > validate the jmethodID before dereferencing it?

The only way I can think of is by keeping a cache of them.

 > Perhaps I'm being too paranoid?

Sure.  I guess you want a debugger to be robust even when the runtime
is FUBAR, but this seems a little extreme.

Andrew.


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