Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix locally scoped constant array #644

Merged
merged 5 commits into from
Jan 31, 2020
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Mono.Cecil/AssemblyReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3017,7 +3017,7 @@ ConstantDebugInformation ReadLocalConstant (uint rid)
value = new decimal (signature.ReadInt32 (), signature.ReadInt32 (), signature.ReadInt32 (), (b & 0x80) != 0, (byte) (b & 0x7f));
} else if (type.IsTypeOf ("System", "DateTime")) {
value = new DateTime (signature.ReadInt64());
} else if (type.etype == ElementType.Object || type.etype == ElementType.None || type.etype == ElementType.Class) {
} else if (type.etype == ElementType.Object || type.etype == ElementType.None || type.etype == ElementType.Class || type.etype == ElementType.Array) {
value = null;
} else
value = signature.ReadConstantSignature (type.etype);
Expand Down
8 changes: 8 additions & 0 deletions Test/Mono.Cecil.Tests/ImageReadTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,14 @@ public void Net471TargetingAssembly ()
});
}

[Test]
public void LocallyScopedConstantArray ()
{
TestModule ("LocallyScopedConstantArray.dll", module => {
Assert.IsTrue (module.HasDebugHeader);
SimonCropp marked this conversation as resolved.
Show resolved Hide resolved
}, symbolReaderProvider: typeof (PortablePdbReaderProvider), symbolWriterProvider: typeof (PortablePdbWriterProvider));
}

[Test]
public void ExternalPdbDeterministicAssembly ()
{
Expand Down
Binary file not shown.
Binary file not shown.