@@ -259,7 +259,9 @@ ProtectionSettingsInfo ToInfo(Rule rule, PatternExpression expr) {
259259 IEnumerable < ProtectionSettingsInfo > ReadInfos ( IHasCustomAttribute item ) {
260260 foreach ( var attr in ReadObfuscationAttributes ( item ) ) {
261261 ProtectionSettingsInfo info ;
262- if ( ToInfo ( attr , out info ) )
262+ if ( ! string . IsNullOrEmpty ( attr . FeatureName ) )
263+ yield return AddRule ( attr , null ) ;
264+ else if ( ToInfo ( attr , out info ) )
263265 yield return info ;
264266 }
265267 }
@@ -327,7 +329,7 @@ protected internal override MarkerResult MarkProject(ConfuserProject proj, Confu
327329 return new MarkerResult ( modules . Select ( module => module . Item2 ) . ToList ( ) , packer , extModules ) ;
328330 }
329331
330- void AddRule ( ObfuscationAttributeInfo attr , List < ProtectionSettingsInfo > infos ) {
332+ ProtectionSettingsInfo AddRule ( ObfuscationAttributeInfo attr , List < ProtectionSettingsInfo > infos ) {
331333 Debug . Assert ( attr . FeatureName != null ) ;
332334
333335 var pattern = attr . FeatureName ;
@@ -356,8 +358,9 @@ void AddRule(ObfuscationAttributeInfo attr, List<ProtectionSettingsInfo> infos)
356358
357359 if ( ! ok )
358360 context . Logger . WarnFormat ( "Ignoring rule '{0}' in {1}." , info . Settings , attr . Owner ) ;
359- else
361+ else if ( infos != null )
360362 infos . Add ( info ) ;
363+ return info ;
361364 }
362365
363366 void MarkModule ( ProjectModule projModule , ModuleDefMD module , Rules rules , bool isMain ) {
0 commit comments