Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion MethodDecorator.Fody/MethodDecorator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ public MethodDecorator(ModuleDefinition moduleDefinition) {
public void Decorate(TypeDefinition type, MethodDefinition method, CustomAttribute attribute, bool explicitMatch)
{


method.Body.InitLocals = true;

var methodBaseTypeRef = this._referenceFinder.GetTypeReference(typeof(MethodBase));
Expand Down Expand Up @@ -182,8 +181,13 @@ public void Decorate(TypeDefinition type, MethodDefinition method, CustomAttribu
processor.InsertBefore(methodBodyFirstInstruction, bypassInstructions);

if (callOnEntryInstructions != null)
{
processor.InsertBefore(methodBodyFirstInstruction, callOnEntryInstructions);

if (bypassInstructions != null)
processor.InsertBefore(methodBodyFirstInstruction, bypassInstructions);
}

if (methodBodyReturnInstructions != null)
{
processor.InsertAfter(method.Body.Instructions.Last(), methodBodyReturnInstructions);
Expand Down
6 changes: 3 additions & 3 deletions MethodDecoratorInterfaces/IPartialDecorator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ public interface IPartialDecoratorException
{
void OnException(Exception iException);
}
interface IPartialDecoratorContinuation
public interface IPartialDecoratorContinuation
{
void OnTaskContinuation(Task task);
}
interface IPartialDecoratorNeedBypass
public interface IPartialDecoratorNeedBypass
{
bool NeedBypass();
}
interface IPartialAlterRetval
public interface IPartialAlterRetval
{
object AlterRetval(object iRetval);
}
Expand Down