BepInEx.ScriptLoader icon indicating copy to clipboard operation
BepInEx.ScriptLoader copied to clipboard

Enum Crash

Open kice opened this issue 4 years ago • 0 comments

// #name enum_test

using System;

public enum A
{
    B,
    C,
    D,
}

// crash if type of a is enum
public class Test
{
    public A a;

    static public Test aa = new Test(A.B);

    public Test(A a)
    {
        this.a = a;
    }
}

//public class Test2
//{
//    public int a;

//    static public Test2 aa = new Test2(0);

//    public Test2(int a)
//    {
//        this.a = a;
//    }
//}

public static class EnumTest
{
    public static void Main()
    {
    }
}

Unity Player [version: Unity 5.6.4p2_278fc6850ee0]

mono.dll caused an Access Violation (0xc0000005) in module mono.dll at 0033:d7ad4f24.

Read from location 00000008 caused an access violation.

Initialize engine version: 5.6.4p2 (278fc6850ee0)

========== OUTPUTING STACK TRACE ==================

0x00007FFCD7AD0367 (mono) mono_class_is_valuetype
0x00007FFCD7B436F8 (mono) mono_type_get_object
0x00007FFCD7B3DCD9 (mono) mono_property_get_object
0x00000000079B2513 (Mono JIT Code) (wrapper managed-to-native) System.Reflection.Emit.TypeBuilder:create_runtime_class (System.Reflection.Emit.TypeBuilder)
0x00000000079B197C (Mono JIT Code) System.Reflection.Emit.TypeBuilder:CreateType ()
0x000000000BE3FB42 (Mono JIT Code) Mono.CSharp.TypeDefinition:CloseContainer ()
0x000000000BE3F7AC (Mono JIT Code) Mono.CSharp.TypeContainer:CloseContainer ()
0x000000000BE3F7AC (Mono JIT Code) Mono.CSharp.TypeContainer:CloseContainer ()
0x000000000BE3F60A (Mono JIT Code) Mono.CSharp.ModuleContainer:CloseContainer ()
0x00000000079F963A (Mono JIT Code) ScriptLoader.MonoCompiler:Compile (System.Collections.Generic.Dictionary`2<string, byte[]>,System.IO.TextWriter)
0x00000000079EC8C2 (Mono JIT Code) ScriptLoader.ScriptLoader:CompileScripts ()
0x00000000335493A8 (Mono JIT Code) ScriptLoader.ScriptLoader:Update ()
0x0000000004D92D72 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr)
0x00007FFCD7BCADFC (mono) mono_walk_stack
0x00007FFCD7B28A9D (mono) mono_runtime_invoke
...<Game Call Stack>...
0x00007FFD6C907034 (KERNEL32) BaseThreadInitThunk
0x00007FFD6CC22651 (ntdll) RtlUserThreadStart

========== END OF STACKTRACE ===========

**** Crash! ****

Either a bug of compiler or incorrect parameters were feed into compiler.

kice avatar Jul 16 '21 15:07 kice