File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -845,13 +845,15 @@ struct TargetVTableDescriptorHeader {
845
845
template <typename Runtime>
846
846
struct TargetMethodOverrideDescriptor {
847
847
// / The class containing the base method.
848
- TargetRelativeIndirectablePointer<Runtime, TargetClassDescriptor<Runtime>> Class;
848
+ TargetRelativeIndirectablePointer<Runtime, TargetClassDescriptor<Runtime>,
849
+ /* nullable*/ true > Class;
849
850
850
851
// / The base method.
851
- TargetRelativeIndirectablePointer<Runtime, TargetMethodDescriptor<Runtime>> Method;
852
+ TargetRelativeIndirectablePointer<Runtime, TargetMethodDescriptor<Runtime>,
853
+ /* nullable*/ true > Method;
852
854
853
855
// / The implementation of the override.
854
- TargetRelativeDirectPointer<Runtime, void , /* Nullable= */ true > Impl;
856
+ TargetRelativeDirectPointer<Runtime, void , /* nullable */ true > Impl;
855
857
};
856
858
857
859
// / Header for a class vtable override descriptor. This is a variable-sized
Original file line number Diff line number Diff line change @@ -2319,6 +2319,11 @@ static void initClassVTable(ClassMetadata *self) {
2319
2319
auto *baseClass = descriptor.Class .get ();
2320
2320
auto *baseMethod = descriptor.Method .get ();
2321
2321
2322
+ // If the base method is null, it's an unavailable weak-linked
2323
+ // symbol.
2324
+ if (baseClass == nullptr || baseMethod == nullptr )
2325
+ continue ;
2326
+
2322
2327
// Calculate the base method's vtable offset from the
2323
2328
// base method descriptor. The offset will be relative
2324
2329
// to the base class's vtable start offset.
You can’t perform that action at this time.
0 commit comments