[runtime] Fix handler block
authorVlad Brezae <brezaevlad@gmail.com>
Mon, 24 Jul 2017 18:08:52 +0000 (21:08 +0300)
committerVlad Brezae <brezaevlad@gmail.com>
Tue, 25 Jul 2017 09:23:34 +0000 (12:23 +0300)
commitba95f34c0a23e98f2e08f0b2a16df36a66fec006
tree69016ea1eec1013bedd9b2f860e6433bcd24d665
parent2657d9cb1ed6a4b9885943518f6fc5d69f4550dc
[runtime] Fix handler block

Instead of hijacking the return address when suspending a thread in a finally block for an abort, do an explicit check in managed code when we are returning from the handler in order to see if we need to abort. Hijacking the return address is arch specific and it doesn't work if we are suspended before it is initialized in handler start.

Fixes #5798
mono/metadata/threads-types.h
mono/metadata/threads.c
mono/mini/method-to-ir.c
mono/mini/mini-exceptions.c
mono/mini/mini-runtime.c
mono/mini/mini.c
mono/mini/mini.h