diff options
author | Aaron Smith <aaron.smith@microsoft.com> | 2020-04-30 09:38:19 -0700 |
---|---|---|
committer | Aaron Smith <aaron.smith@microsoft.com> | 2020-04-30 09:38:19 -0700 |
commit | 4eabd006125424f879a7129eca824998192d89a9 (patch) | |
tree | 934e82b10b9cc7aef02fd8d51c9a1c67f3b2f8cc /llvm/lib/IR/Function.cpp | |
parent | b257d3c8a897b9999b9bdb660fc8eaad772a0085 (diff) | |
download | llvm-4eabd006125424f879a7129eca824998192d89a9.zip llvm-4eabd006125424f879a7129eca824998192d89a9.tar.gz llvm-4eabd006125424f879a7129eca824998192d89a9.tar.bz2 |
[Windows SEH] Fix abnormal-exits in _try
Summary:
Per Windows SEH Spec, except _leave, all other early exits of a _try (goto/return/continue/break) are considered abnormal exits. In those cases, the first parameter passes to its _finally funclet should be TRUE to indicate an abnormal-termination.
One way to implement abnormal exits in _try is to invoke Windows runtime _local_unwind() (MSVC approach) that will invoke _dtor funclet where abnormal-termination flag is always TRUE when calling _finally. Obviously this approach is less optimal and is complicated to implement in Clang.
Clang today has a NormalCleanupDestSlot mechanism to dispatch multiple exits at the end of _try. Since _leave (or try-end fall-through) is always Indexed with 0 in that NormalCleanupDestSlot, this fix takes the advantage of that mechanism and just passes NormalCleanupDest ID as 1st Arg to _finally.
Reviewers: rnk, eli.friedman, JosephTremoulet, asmith, efriedma
Reviewed By: efriedma
Subscribers: efriedma, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D77936
Diffstat (limited to 'llvm/lib/IR/Function.cpp')
0 files changed, 0 insertions, 0 deletions