[interp] Retain trace during exception checkpoint (#56825)
authorVlad Brezae <brezaevlad@gmail.com>
Wed, 4 Aug 2021 15:29:22 +0000 (18:29 +0300)
committerGitHub <noreply@github.com>
Wed, 4 Aug 2021 15:29:22 +0000 (10:29 -0500)
commite74f18146f70c372b29626eb3ca23c82e9bf265e
tree49205fd31374fcef3d3821225df4e4e8b18c1ede
parent2020ed320fd488cf6a1f4fecd37b5a9112edd0dd
[interp] Retain trace during exception checkpoint (#56825)

When an exception needs to cross a native boundary, it can be caught by the runtime invoke wrapper and this exception will end up as a pending exception. With JIT, the initial managed to native wrapper will check for a pending exception and will use a CEE_MONO_RETHROW opcode in order to preserve the stacktrace. With the interp we do the exception checkpoint outside of the native wrapper, and we need to do it in rethrow fashion (without clearing the original trace).
src/mono/mono/mini/interp/interp.c