Ticket #165 (closed enhancement: fixed)

Opened 4 years ago

Last modified 4 years ago

Report dangerous callin bindings (equals & hashCode)

Reported by: stephan Owned by: stephan
Priority: major Milestone: OTDT_1.2.5
Component: compiler Version: 1.2.4
Keywords: Cc:

Description

When callin-binding a base class's equals or hashCode method, a StackOverflowError can occur because the lifting infrastructure uses exactly these methods during callin dispatch.

I recently (r19249) ensured that isExecutingCallin() is checked early enough so that the following binding works:

myEquals <- replace equals
  base when (!isExecutingCallin());

(See also 9.2.4-otjld-is-executing-callin-called-5, note that the role cache has to be filled with lots of roles for a hash-conflict to occur so that equals() will actually be called).

However, calling bindings to these two methods should be flagged with a warning to alert the user of the danger of infinite recursion.

Change History

Changed 4 years ago by stephan

  • status changed from new to assigned

Changed 4 years ago by stephan

  • status changed from assigned to closed
  • resolution set to fixed

Test pass, no regression, closing as fixed.

Note: See TracTickets for help on using tickets.