Skip to content

Commit

Permalink
add bool & float instruction
Browse files Browse the repository at this point in the history
  • Loading branch information
chromee committed Mar 17, 2020
1 parent 397c3a5 commit 433b065
Showing 1 changed file with 11 additions and 0 deletions.
Expand Up @@ -634,6 +634,17 @@ TypeReference CreateGenericInstanceWithParameters(TypeDefinition typeDef)
instructions.Add(Instruction.Create(OpCodes.Ldc_I4, (int)identifier));
instructions.Add(Instruction.Create(OpCodes.Box, _module.Import(identifier.GetType())));
}
else if (identifier is float)
{
instructions.Add(Instruction.Create(OpCodes.Ldc_R4, (float)identifier));
instructions.Add(Instruction.Create(OpCodes.Box, _module.Import(typeof(float))));
}
else if (identifier is bool)
{

instructions.Add(Instruction.Create(OpCodes.Ldc_I4, (bool)identifier ? 1 : 0));
instructions.Add(Instruction.Create(OpCodes.Box, _module.Import(typeof(bool))));
}
else
{
throw Assert.CreateException(
Expand Down

0 comments on commit 433b065

Please sign in to comment.