Skip to content

Commit

Permalink
Core: Don't attempt to write UnknownGlobals to attribute params
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Byass committed Jan 4, 2022
1 parent bb5a5cf commit 4ee07d1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Cpp2IL.Core/Utils/AnalysisUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ public static long[] ReadArrayInitializerForFieldDefinition(FieldDefinition fiel

if (value is Il2CppString)
throw new Exception("Cannot coerce an Il2CppString. Something has gone wrong here");

if (value is UnknownGlobalAddr)
throw new Exception("Cannot coerce an UnknownGlobal. Something has gone wrong here");

if (coerceToType.Resolve() is { IsEnum: true } enumType)
coerceToType = enumType.GetEnumUnderlyingType();
Expand Down

0 comments on commit 4ee07d1

Please sign in to comment.