You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Cpp2IL.Core/InstructionSets/WasmInstructionSet.cs
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -20,12 +20,12 @@ public override Memory<byte> GetRawBytesForMethod(MethodAnalysisContext context,
20
20
21
21
if(wasmDef==null)
22
22
{
23
-
Logger.WarnNewline($"Could not find WASM definition for method {methodDefinition.HumanReadableSignature} in {methodDefinition.DeclaringType?.FullName}, probably incorrect signature calculation (signature was {WasmUtils.BuildSignature(context)})","WasmInstructionSet");
23
+
Logger.WarnNewline($"Could not find WASM definition for method {methodDefinition.HumanReadableSignature} in {methodDefinition.DeclaringType?.FullName}, probably incorrect signature calculation (signature was {WasmUtils.BuildSignature(context)}, index is {context.UnderlyingPointer})","WasmInstructionSet");
24
24
returnArray.Empty<byte>();
25
25
}
26
26
27
27
if(wasmDef.AssociatedFunctionBody==null)
28
-
thrownew($"WASM definition {wasmDef}, resolved from MethodAnalysisContext {context.Definition.HumanReadableSignature} in {context.DeclaringType?.FullName} has no associated function body (signature was {WasmUtils.BuildSignature(context)})");
28
+
thrownew($"WASM definition {wasmDef}, resolved from MethodAnalysisContext {context.Definition.HumanReadableSignature} in {context.DeclaringType?.FullName} has no associated function body (signature was {WasmUtils.BuildSignature(context)}, index is {context.UnderlyingPointer})");
Copy file name to clipboardExpand all lines: Cpp2IL.Core/Utils/WasmUtils.cs
+11-6Lines changed: 11 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -32,10 +32,9 @@ public static string BuildSignature(MethodAnalysisContext definition)
32
32
:definition.ReturnTypeswitch
33
33
{
34
34
{Namespace:nameof(System),Name:"Void"}=>"v",
35
-
{IsValueType:true,Definition:null or {Size:<0 or >8}}=>"vi",//Large or Generic Struct returns have a void return type, but the actual return value is the first parameter.
36
-
{IsValueType:true,Definition.Size:>4}=>"j",//Medium structs are returned as longs
37
-
{IsValueType:true,Definition.Size:<=4}=>"i",//Small structs are returned as ints
38
-
_ =>GetSignatureLetter(definition.ReturnType!)
35
+
{IsValueType:true,Definition:null or {Size:>8}}=>"vi",//Large or Generic Struct returns have a void return type, but the actual return value is the first parameter.
36
+
{IsValueType:true,Definition.Size:>0 and <4}=>"i",//Small structs are returned as ints
return$"{returnTypeSignature}{instanceParam}{string.Join("",definition.Parameters!.Select(p =>GetSignatureLetter(p.ParameterType,p.IsRef)))}i";//Add an extra i on the end for the method info param
@@ -49,7 +48,7 @@ public static bool IsWasmPrimitive(this TypeAnalysisContext type)
49
48
returntypeEnumis>=Il2CppTypeEnum.IL2CPP_TYPE_BOOLEAN and <=Il2CppTypeEnum.IL2CPP_TYPE_R8;
_ when!type.IsWasmPrimitive()&&typeis{IsValueType:true,IsEnumType:false,Definition.Size:<=8 and >0}=>"j",//TODO check - value types < 16 bytes (including base object header which is irrelevant here) are passed directly as long?
0 commit comments