agiledragon / gomonkey

gomonkey is a library to make monkey patching in unit tests easy
MIT License
2k stars 179 forks source link

arm64架构下给简单函数打补丁会造成程序异常 #64

Closed hengwu0 closed 2 years ago

hengwu0 commented 2 years ago

当给如下函数打补丁:

func ok() bool {
    return true
}

会造成程序段错误退出。原因是由于该函数的汇编形式只有4个汇编语句,而补丁会打入6个汇编,造成下一个函数序言被破坏

agiledragon commented 2 years ago

It has no any effect on the formal go project.