On Wed, Feb 18, 2004 at 01:58:04AM -0800, Nikhil C. Khedkar wrote:
>       Now the above mentioned approach doesn't work and I
> end up putting my method call before super() and get
> VerifyError.

Since the constructor has a special name (<init>) you
can know that you are dealing with a constructor.
If so, scan the whole method for a call to the
superclass constructor (INVOKESPECIAL to a method called
<init>).  If you don't find it (it seems legal according to
http://java.sun.com/docs/books/vmspec/2nd-edition/html/Concepts.doc.html#16411
) then you can put your instrumenting call at the start,
otherwise you put the call after the INVOKESPECIAL call.

I haven't tried it, so I'd be interested in whether it works.
I'm going to be needing it realy soon for my own project.

-- 
Erik Corry         I'd be a Libertarian, if they weren't all a
[EMAIL PROTECTED]     bunch of tax-dodging professional whiners.   - B. Breathed.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to