bytedance/mockey

unsafe mock

ycydsxy opened this issue · 0 comments

Is your feature request related to a problem? Please describe.

In many cases, the function has only one line or fewer:

func Foo() {
    // do nothing
}

The error "function is too short" occurs when mocking because the instructions to be inserted is longer than the target function itself.

Describe the solution you'd like

provide a MockUnsafe function instead of Mock to deal with this situation and ignore these security restrictions.

Describe alternatives you've considered

none

Additional context

It may cause some unknown problems because we may polluted the memory space which doesn't belong to the target function.