Faculty of Information Technology
Software Engineering Group

#73 closed defect (fixed)

Add tests for selector namespaces to regression tests

Reported by: vranyj1 Owned by:
Priority: major Milestone:
Component: default Keywords:
Cc: Also affects CVS HEAD (eXept version): no


...and then fix them.

Change History (1)

comment:1 Changed 15 months ago by Jan Vrany

Resolution: fixed
Status: newclosed

Tests added in:

Small fixes were needed in stx:libbasic

And two fixes for horrible bugs in the VM:

  • 47e814cbf1ea: Oops, fixed horrible bug in method lookup MOP

Due to horrible slip in lookup_lookup(), caller-defined lookup object
was never consulted. This indeed broke selector namespaces implementation.

  • f9b289f7d749: Fixed nasty bug in method lookup MOP on x86_64

When send routine is about to call custom lookup method it does so by means
of calling __externalLookupMethodX() routine. For up to 4 arguments there
are specialized methods, for 5 and more arguments one generic
__externalLookupMethodN() is (was) called. (Probably) to make it easy,
the "N" routine took a number of arguments and a pointer to the first argument
of a send, assuming argument values are located in a memory (!) and one
after each other. Only that this is true only (?) for trad-stack machines (i.e.,
i386). NOT for machines where arguments are passed in registers such as
x86_64. This lead to nice crashes as __externalLookupMethodN() packed random
garbage to an argument array. Sigh!

The fix is simple - make __externalLookupMethodN() a vararg function, pass
args to it a usual and use macros defined in #include <stdarg.h> to access them
inside __externalLookupMethodN(). Should work on all platforms with a reasonable
C99 compiler.

All tests pass now.

Note: See TracTickets for help on using tickets.