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

3个直接崩溃的例子 #23

Closed
tinygridlock opened this issue Apr 11, 2022 · 7 comments
Closed

3个直接崩溃的例子 #23

tinygridlock opened this issue Apr 11, 2022 · 7 comments

Comments

@tinygridlock
Copy link

2020.3.7f1 standalone包

using System;
using System.Collections.Generic;
using UnityEngine;

public class App
{
public static int Main()
{
Test3();
Test4();
Test5();
return 0;
}

public static void Test3()
{
    var a1 = new A1();
    a1.Test<string>((a) => { });
    a1.Test<string>((a) => { });
}

public class A1
{
    public void Test<T>(Action<T> callback)
    {
        callback?.Invoke(default);
    }
}

public static void Test4()
{
    var b = new B2();
    b.Dict = new Dictionary<string, string>();
    b.Dict.Add("123", "123");
    b.Dict["123"] = "456";
}

public class B2
{
    public Dictionary<string, string> Dict { get; set; }
}

public static void Test5()
{
    C3 a;
    a.F = 123;
    a.V = new Vector3(4, 5, 6);
    var pos = a.V;
    pos.x += 111;
}

public struct C3
{
    public float F;
    public Vector3 V;
}

}

@pirunxi
Copy link
Contributor

pirunxi commented Apr 11, 2022

复测,只有Test5才会崩溃。 已修复提交。

@pirunxi pirunxi closed this as completed Apr 11, 2022
@tinygridlock
Copy link
Author

麻烦再确认下看?Test3和Test4在4月8日之前的版本是好的,我这边在目前最新的版本里崩溃了

@pirunxi
Copy link
Contributor

pirunxi commented Apr 11, 2022

我就是拿最新的huatuo版本测的。这样吧,你把你的libil2cpp目录QQ上发给我。

@tinygridlock
Copy link
Author

我这边再确认下,如果还有问题,在QQ上把目录发你。

@tinygridlock
Copy link
Author

我这边测试发现是编译成release的dll会崩,debug的dll不崩

@pirunxi
Copy link
Contributor

pirunxi commented Apr 15, 2022

ok. 我复测一下。由于release与debug生成的指令不一样,所以确实可能发生这种情况。 很重要。帮助我们发现几个bug。

@pirunxi pirunxi reopened this Apr 15, 2022
@pirunxi
Copy link
Contributor

pirunxi commented Apr 15, 2022

确认bug。已修复。dup指令未正确计算栈大小引起。

@pirunxi pirunxi closed this as completed Apr 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants