Skip to content

Commit

Permalink
Fixed an analyzer crash caused by invalid type attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
ElektroKill committed Jan 3, 2023
1 parent c011dc0 commit d58b752
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
Expand Down Expand Up @@ -190,6 +190,7 @@ public ScopedWhereUsedAnalyzer(IDsDocumentService documentService, FieldDef fiel
Accessibility result;
switch (type.Attributes & TypeAttributes.VisibilityMask) {
case TypeAttributes.NestedPublic:
case TypeAttributes.Public: // Invalid but sometimes emitted by obfuscators
result = Accessibility.Public;
break;
case TypeAttributes.NestedPrivate:
Expand All @@ -199,6 +200,7 @@ public ScopedWhereUsedAnalyzer(IDsDocumentService documentService, FieldDef fiel
result = Accessibility.Family;
break;
case TypeAttributes.NestedAssembly:
case TypeAttributes.NotPublic: // Invalid but sometimes emitted by obfuscators
result = Accessibility.Internal;
break;
case TypeAttributes.NestedFamANDAssem:
Expand Down

2 comments on commit d58b752

@sunnamed434
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bitmono cries

@mitoiscool
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

common bitmono W

Please sign in to comment.