Skip to content

Commit

Permalink
Fix a decompilation error where a reference to a generated delegate's…
Browse files Browse the repository at this point in the history
… name was wrongly being stripped.
  • Loading branch information
EliotVU committed Nov 2, 2022
1 parent db16d2a commit 5141285
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/Core/Classes/UDefaultProperty.cs
Original file line number Diff line number Diff line change
Expand Up @@ -611,9 +611,18 @@ private string DeserializeDefaultPropertyValue(PropertyType type, ref Deserializ
string delegateName = _Buffer.ReadName();
Record(nameof(delegateName), delegateName);

// Strip __%delegateName%__Delegate
string normalizedDelegateName = ((string)Name).Substring(2, Name.Length - 12);
propertyValue = $"{normalizedDelegateName}={delegateName}";
// Re-point the compiler-generated delegate property to the actual delegate function's name
// e.g. __%delegateName%__Delegate -> %delegateName%
if (delegateName.EndsWith("__Delegate"))
{
string normalizedDelegateName = ((string)Name).Substring(2, Name.Length - 12);
propertyValue = $"{normalizedDelegateName}={delegateName}";
}
else
{
propertyValue += delegateName;
}

break;
}

Expand Down

0 comments on commit 5141285

Please sign in to comment.