Skip to content

Commit dafb77a

Browse files
author
Max Charlamb
committed
fix tests
1 parent 7d44c8e commit dafb77a

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/native/managed/cdac/tests/MockDescriptors/MockDescriptors.MethodDescriptors.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,15 @@ internal MethodDescriptors(RuntimeTypeSystem rtsBuilder, Loader loaderBuilder, (
100100
LoaderBuilder = loaderBuilder;
101101
_allocator = Builder.CreateAllocator(allocationRange.Start, allocationRange.End);
102102
Types = GetTypes();
103+
104+
// Add dummy MethodDescSizeTable. Sizes will be incorrect, but we don't use it in tests.
105+
MockMemorySpace.HeapFragment methodDescSizeTable = _allocator.Allocate(0x100, "MethodDescSizeTable");
106+
Builder.AddHeapFragment(methodDescSizeTable);
107+
103108
Globals = rtsBuilder.Globals.Concat(
104109
[
105110
new(nameof(Constants.Globals.MethodDescTokenRemainderBitCount), TokenRemainderBitCount),
111+
new(nameof(Constants.Globals.MethodDescSizeTable), methodDescSizeTable.Address),
106112
]).ToArray();
107113
}
108114

src/native/managed/cdac/tests/MockDescriptors/MockDescriptors.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ internal record TypeFields
3838
Fields =
3939
[
4040
new(nameof(Data.EEClass.MethodTable), DataType.pointer),
41+
new(nameof(Data.EEClass.MethodDescChunk), DataType.pointer),
4142
new(nameof(Data.EEClass.CorTypeAttr), DataType.uint32),
4243
new(nameof(Data.EEClass.NumMethods), DataType.uint16),
4344
new(nameof(Data.EEClass.InternalCorElementType), DataType.uint8),
@@ -138,6 +139,8 @@ internal record TypeFields
138139
new(nameof(Data.Module.FileName), DataType.pointer),
139140
new(nameof(Data.Module.ReadyToRunInfo), DataType.pointer),
140141
new(nameof(Data.Module.GrowableSymbolStream), DataType.pointer),
142+
new(nameof(Data.Module.AvailableTypeParams), DataType.pointer),
143+
new(nameof(Data.Module.InstMethodHashTable), DataType.pointer),
141144
new(nameof(Data.Module.FieldDefToDescMap), DataType.pointer),
142145
new(nameof(Data.Module.ManifestModuleReferencesMap), DataType.pointer),
143146
new(nameof(Data.Module.MemberRefToDescMap), DataType.pointer),

0 commit comments

Comments
 (0)