Skip to content

Instantly share code, notes, and snippets.

@lambdageek
Created April 29, 2019 23:02
Show Gist options
  • Select an option

  • Save lambdageek/cdc3142f68643288352d699d5e33d96a to your computer and use it in GitHub Desktop.

Select an option

Save lambdageek/cdc3142f68643288352d699d5e33d96a to your computer and use it in GitHub Desktop.
.PHONY: all run clean
all: Repro13734.exe
Repro13734.exe: Repro13734.cs Point.dll
csc -r:Point.dll Repro13734.cs
Point.dll: Point.cs
csc -target:library Point.cs
run:
-rm -f Point.dll
mono Repro13734.exe
clean:
-rm -f Point.dll Repro13734.dll
public struct Point {
public int X;
}
using System;
using System.Runtime.InteropServices;
// The crash happens when we init an auto layout valuetype with a field from a missing assembly.
[StructLayout (LayoutKind.Auto)]
public struct H<T> {
public T TheOne;
public T TheOther;
}
public struct B {
public Point X;
public B (Point a)
{
X = a;
}
}
public class C {
public H<B> floof;
public C () { }
}
public class M {
public static void Main () {
_ = new C();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment