assemblyscript
assemblyscript copied to clipboard
fix: fix shadowstack pass discard debuginfo
In shadowstack pass, if some function need to add temp local, It need to be removed and re-added. It will discard all debug info because debug info bind with functionref.
This PR aims at re-assign the debug info after shadowstack pass
- [x] I've read the contributing guidelines
- [x] I've added my name and email to the NOTICE file
Would it perhaps be preferable to add a replaceFunction(..., preserveDebugInfo = true)
helper of sorts that can be called instead of removing the function and adding a new one? I guess then we'd not need to remember intermediate state.
Yeah, also prefer to update
updateFunction(funcRef: FunctionRef)
to
updateFunction(funcRef: FunctionRef, preserveDebugInfo: bool)
or simply check this.options.debugInfo
inside updateFunction
Would it perhaps be preferable to add a
replaceFunction(..., preserveDebugInfo = true)
helper of sorts that can be called instead of removing the function and adding a new one? I guess then we'd not need to remember intermediate state.
You mean add this API in binaryen? I also agree it is more eleganta