From ef481ad5789fec53932f42fd0071fa932f652dee Mon Sep 17 00:00:00 2001 From: kudzu_cp <6d05c8c8ef5431987001abfdb2eadc9593ac9498> Date: Sun, 13 Sep 2009 03:26:46 +0000 Subject: [PATCH] --- source2/IL2PCU/Cosmos.IL2CPU/ILScanner.cs | 45 ++++++++++++----------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/source2/IL2PCU/Cosmos.IL2CPU/ILScanner.cs b/source2/IL2PCU/Cosmos.IL2CPU/ILScanner.cs index c8c20be5e..29aa9fe61 100644 --- a/source2/IL2PCU/Cosmos.IL2CPU/ILScanner.cs +++ b/source2/IL2PCU/Cosmos.IL2CPU/ILScanner.cs @@ -465,28 +465,33 @@ namespace Cosmos.IL2CPU { } } - //TODO: For signature ones, we could cache the attrib. Thats - // why we check for null here - if (xAttrib == null) { - // TODO: Only allow one, but this code for now takes the last one - // if there is more than one - foreach (PlugMethodAttribute x in xResult.GetCustomAttributes(typeof(PlugMethodAttribute), false)) { - xAttrib = x; + // If we found a matching method, check for attributes + // that might disable it. + if (xResult != null) { + //TODO: For signature ones, we could cache the attrib. Thats + // why we check for null here + if (xAttrib == null) { + // TODO: Only allow one, but this code for now takes the last one + // if there is more than one + foreach (PlugMethodAttribute x in xResult.GetCustomAttributes(typeof(PlugMethodAttribute), false)) { + xAttrib = x; + } } - } - // See if we need to disable this plug - if (xAttrib != null) { - if (!xAttrib.Enabled) { - xResult = null; - } else if (xAttrib.IsMonoOnly) { - //TODO: Check this against build options - //TODO: Two exclusive IsOnly's dont make sense - // refactor these as a positive rather than negative - // Same thing at type plug level - xResult = null; + // See if we need to disable this plug + if (xAttrib != null) { + if (!xAttrib.Enabled) { + xResult = null; + } else if (xAttrib.IsMonoOnly) { + //TODO: Check this against build options + //TODO: Two exclusive IsOnly's dont make sense + // refactor these as a positive rather than negative + // Same thing at type plug level + xResult = null; + } } - } + } + return xResult; //Type xAssembler = null; // } else if (xAttrib.Signature != null) { // System_Void__Indy_IL2CPU_Assembler_Assembler__cctor__ @@ -610,8 +615,6 @@ namespace Cosmos.IL2CPU { // } //} //} - - return xResult; } protected MethodBase ResolvePlug(MethodBase aMethod, Type[] aParamTypes) {