-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Vtable Mapping For Diamond Inheritance
Fixes #22
- Loading branch information
1 parent
04ae2b7
commit e308005
Showing
5 changed files
with
150 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
class A | ||
{ | ||
public: | ||
A(){} | ||
virtual ~A(){} | ||
virtual void method_b(void) = 0; | ||
virtual void method_c(void) = 0; | ||
virtual void method_d(void) = 0; | ||
}; | ||
|
||
class B:virtual public A | ||
{ | ||
public: | ||
B(){}; | ||
virtual ~B(){}; | ||
virtual void method_b(void) {} | ||
virtual void method_c(void) {} | ||
}; | ||
|
||
class C:virtual public A | ||
{ | ||
public: | ||
C(){} | ||
virtual ~C(){} | ||
virtual void method_b(void) {} | ||
virtual void method_c(void) {} | ||
virtual void method_d(void) {} | ||
}; | ||
|
||
class D:virtual public B | ||
{ | ||
public: | ||
D(){} | ||
virtual ~D(){} | ||
virtual void method_d(void) {} | ||
C c; | ||
}; | ||
|
||
void dummy() | ||
{ | ||
D d; | ||
} | ||
|
||
void test(A *a) __attribute__((annotate("realtime"))) | ||
{ | ||
a->method_b(); | ||
a->method_c(); | ||
a->method_d(); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
class A | ||
{ | ||
public: | ||
A(){} | ||
virtual ~A(){} | ||
virtual void method_b(void) = 0; | ||
virtual void method_c(void) = 0; | ||
virtual void method_d(void) = 0; | ||
}; | ||
|
||
class B:virtual public A | ||
{ | ||
public: | ||
B(){}; | ||
virtual ~B(){}; | ||
virtual void method_b(void) {} | ||
}; | ||
|
||
class C:virtual public A | ||
{ | ||
public: | ||
C(){} | ||
virtual ~C(){} | ||
virtual void method_c(void) {} | ||
}; | ||
|
||
class D:virtual public B, virtual public C | ||
{ | ||
public: | ||
D(){} | ||
virtual ~D(){} | ||
virtual void method_d(void) {} | ||
}; | ||
|
||
void dummy() | ||
{ | ||
D d; | ||
} | ||
|
||
void test(A *a) __attribute__((annotate("realtime"))) | ||
{ | ||
a->method_b(); | ||
a->method_c(); | ||
a->method_d(); | ||
} | ||
|