This is the mail archive of the java-discuss@sourceware.cygnus.com 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]

Re: Wrong exception handler called?


At 01:51 PM 5/20/00 -0700, Per Bothner wrote:
>"Gregory R. Warnes" <warnes@biostat.washington.edu> writes:
>
>> Using the GCC 2.95.2 with Bryce's patches I've experienced method calls
>> being resolved to the wrong method.  (Completely wrong method, IE wrong
>> NAME, wrong number and type of parameters, wrong return value!)  This too
>> seemed to come and go as I rearranged the source or compiled from class
>> files instead of java.
>
>That may happen if you change one file in a way that changes the
>virtual function table (such as adding/removing non-static non-final
>methods), and re-compile some but not all files.
>
>It would be nice if we could figure out a way to give a linker error
>in such cases, but I can't offhand think of a way that doesn't
>require a modified linker.

I'm not up on the current linkers, but the old Dec-10 linker I used allowed
you to define a global absolute symbol with the same value in multiple object
files.  As long as all the symbols had the same value, everything was fine.
If one or more of the values definitions differed, you got an error message 
about multiple definitions.

If this kind of function is generally available, you could checksum the
signatures of the functions in the virtual table, and define a global like
MyClassVtabChecksum (or whatever) that would trap any mismatches.  (You would
define the expected values of each class where you call a non-final method.)

-- Glenn Chambers
-- Toledo, Ohio
-- gchamber@bright.net

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