Skip to content

Commit 480d726

Browse files
Fix empty parameter name causing invalid LLVM IR in marshal methods
Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
1 parent dcf5e10 commit 480d726

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Xamarin.Android.Build.Tasks/Utilities/MarshalMethodsNativeAssemblyGenerator.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,12 @@ void AddParameter (Type type)
567567
}
568568

569569
// Every parameter which isn't a primitive type becomes a pointer
570-
parameters.Add (new LlvmIrFunctionParameter (type, implementedMethod.Parameters[parameters.Count].Name));
570+
// If the parameter name is null or empty, pass null to let LlvmIrFunction assign a numeric name
571+
string? paramName = implementedMethod.Parameters[parameters.Count].Name;
572+
if (String.IsNullOrEmpty (paramName)) {
573+
paramName = null;
574+
}
575+
parameters.Add (new LlvmIrFunctionParameter (type, paramName));
571576
}
572577
}
573578

0 commit comments

Comments
 (0)