[arm64] Fix finally abort
authorVlad Brezae <brezaevlad@gmail.com>
Wed, 21 Dec 2016 01:29:49 +0000 (03:29 +0200)
committerVlad Brezae <brezaevlad@gmail.com>
Wed, 21 Dec 2016 01:40:16 +0000 (03:40 +0200)
commit6bc46fb15e4dfe9fe80b3912902615a3153c5217
tree4015d1096ce52bde5bd113806fc454aa9b31a189
parentda1e7bb0091f98f9512465c93a1fc48024dde6e7
[arm64] Fix finally abort

A try finally set looks like :

try:
   ...
   call finally
E: exit try_block

finally:
   ...
   call E

If we get aborted in the finally block, instead of calling to E, we call to a handler block trampoline which will throw the exception using a context that has the ip at E (since we need to execute the finally block first). We need to make sure that E is not logically part of the try block, otherwise we will end up calling the finally block again when unwinding the stack.
mono/mini/mini-arm64.c