From 42cc514bccba03e00e09fb0a07debcb2fe5ddb0f Mon Sep 17 00:00:00 2001 From: Simon Gockner Date: Wed, 5 Jun 2019 09:52:38 +0200 Subject: [PATCH] - size of the created array should only be the number of arguments (#5) --- .../Registrations/TypedFactoryRegistration.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LightweightIocContainer/Registrations/TypedFactoryRegistration.cs b/LightweightIocContainer/Registrations/TypedFactoryRegistration.cs index d27c78d..127f321 100644 --- a/LightweightIocContainer/Registrations/TypedFactoryRegistration.cs +++ b/LightweightIocContainer/Registrations/TypedFactoryRegistration.cs @@ -102,7 +102,7 @@ namespace LightweightIocContainer.Registrations if (args.Any()) { - generator.Emit(OpCodes.Ldc_I4_S, args.Length + 1); + generator.Emit(OpCodes.Ldc_I4_S, args.Length); generator.Emit(OpCodes.Newarr, typeof(object)); for (int i = 0; i < args.Length; i++)