Clang correctly generates the scope table for Test() (it has one entry which points to the __try block with the exception filter EXCEPTION_EXECUTE_HANDLER).
Clang/LLVM documentation claims that LLVM does not model asynchronous exceptions so it is currently impossible to catch an asynchronous exception generated in the same frame as the catching __try (x86 uses frame-based SEH instead of table based exception handling so it is OK). Our code is correct (after fixing a bug in the ReactOS code RtlpUnwindInternal --- the leaf function case didn't update the context record correctly) and can correct catch and unwind the second example above.
On x64, clang/llvm (version 13.0.1) doesn't seem to generate the correct scope table for the following example
The scope table for the unwind data of
Test()
is empty (it should have one entry corresponding to the__try
block). However the following is OK:Clang correctly generates the scope table for
Test()
(it has one entry which points to the__try
block with the exception filterEXCEPTION_EXECUTE_HANDLER
).Clang/LLVM documentation claims that LLVM does not model asynchronous exceptions so it is currently impossible to catch an asynchronous exception generated in the same frame as the catching
__try
(x86 uses frame-based SEH instead of table based exception handling so it is OK). Our code is correct (after fixing a bug in the ReactOS codeRtlpUnwindInternal
--- the leaf function case didn't update the context record correctly) and can correct catch and unwind the second example above.