tuyoogame / huatuo

huatuo是一个特性完整、零成本、高性能、低内存的近乎完美的Unity全平台原生c#热更方案。 Huatuo is a fully featured, zero-cost, high-performance, low-memory solution for Unity's all-platform native c# hotfix
MIT License
2.31k stars 377 forks source link

提3个bug #21

Closed tinygridlock closed 2 years ago

tinygridlock commented 2 years ago

using UnityEngine; using UnityEngine.UI;

public class App { public static int Main() { Test0(2); Test1("123,456"); Test2(null, null, Color.black); return 0; }

private static void Test0(int c)
{
    //出错在 MetadataParser.cpp 524行 IL2CPP_ASSERT(paramCount == methodDef.parameterCount);
    //B的函数定义只有一个参数 编译成il后会有两个参数
    void B(int d)
    {
        Debug.LogError(c + d);
    }

    B(1);
    B(2);
}

private static void Test1(string str)
{
    //出错在 libil2cpp/vm/Array.cpp 54行 不用huatuo时不出错
    var ss = str.Split(',');
    ss[0] += "qwe";
}

private static void Test2(Image img1, Image img2, Color c1)
{
    //出错在 Transform.cpp 1011行 IL2CPP_ASSERT(false);
    img1.color = img2.color = c1;
}

}

pirunxi commented 2 years ago

确信。已修复 。这三个bug都非常有用,尤其是第一个bug,非常隐秘。感谢!!!