Opened 14 years ago
Last modified 14 years ago
#1438 closed defect (fixed)
Stack overflow for nested class extends
Reported by: | Per Östlund | Owned by: | Per Östlund |
---|---|---|---|
Priority: | critical | Milestone: | |
Component: | Version: | ||
Keywords: | Cc: | Per Östlund, Per Östlund |
Description
The following model results in a stack overflow:
class P1 replaceable class C end C; end P1; class P2 extends P1; redeclare class extends C end C; end P2; class P3 extends P2; redeclare class extends C end C; C c; end P3;
Change History (5)
comment:1 by , 14 years ago
comment:3 by , 14 years ago
I suggested using something like System.mo memory to generate unique IDs for these classes (reset at each inst'ion like hasExpandable, etc).
Note:
See TracTickets
for help on using tickets.
This is used all over Media, so sooner or later you always run into this problem when fixing Media-problems. The cause is that instClassExtendsList2 will rename P1.C to C$parent, and create a new class for P2.C that extends C$parent. When instantiating P3 it will rename P2.C to P2.C$parent, so P2.C$parent will suddenly be extending itself, which causes an infinite loop in instExtendsList.