public static bool Ldfld(Instruction instruction, CompileContext compileContext) { // ldfld field - Push the value of field of object (or value type) obj, onto the stack. var fieldDefinition = (instruction.Operand as FieldReference).Resolve(); var @this = compileContext.Pop(); compileContext.Push(fieldDefinition.FieldType, compileContext.Field(@this, fieldDefinition)); return(true); }
public static bool Stfld(Instruction instruction, CompileContext compileContext) { // stfld field - Replace the value of field of the object obj with value var fieldDefinition = instruction.Operand as FieldDefinition; var value = compileContext.Pop(); var @this = compileContext.Pop(); compileContext.Assign(compileContext.Field(@this, fieldDefinition), value); return(true); }