Skip to content

Commit 7d1376a

Browse files
committed
Fix debug assert issue with vtable methods.
1 parent 615d99e commit 7d1376a

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

src/AST/ClassLayout.cs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,7 @@ public struct VTableComponent
3131
public Declaration Declaration;
3232

3333
/// Method declaration (if Kind == FunctionPointer).
34-
public Method Method
35-
{
36-
get
37-
{
38-
Debug.Assert(Kind == VTableComponentKind.FunctionPointer);
39-
return Declaration as Method;
40-
}
41-
}
34+
public Method Method => Declaration as Method;
4235
}
4336

4437
/// <summary>

src/Generator/AST/VTables.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ private static List<VTableComponent> GatherVTableMethodEntries(VTableLayout layo
3434
where component.Kind != VTableComponentKind.CompleteDtorPointer &&
3535
component.Kind != VTableComponentKind.RTTI &&
3636
component.Kind != VTableComponentKind.UnusedFunctionPointer &&
37+
component.Kind != VTableComponentKind.OffsetToTop &&
3738
component.Method != null
3839
select component);
3940

0 commit comments

Comments
 (0)