]> granicus.if.org Git - clang/commit
Implement jump scope SEHmantic analysis.
authorNico Weber <nicolasweber@gmx.de>
Tue, 3 Feb 2015 17:06:08 +0000 (17:06 +0000)
committerNico Weber <nicolasweber@gmx.de>
Tue, 3 Feb 2015 17:06:08 +0000 (17:06 +0000)
commit2c7b0780fa661ec22dacfb34070f578198c65806
treeb6e30a0adba8882d66d78df0e8d5a82ac6ea45cc
parent620d7d7b07654b3e97f3805e23e533e8142f9f66
Implement jump scope SEHmantic analysis.

Thou shall not jump into SEH blocks. Jumping out of SEH __try and __excepts
is A-ok. Jumping out of __finally blocks is B-ok (msvc doesn't error about it,
but warns that it has undefined behavior).

I've checked that clang's behavior with this patch matches msvc's behavior.
We don't have the warning on jumping out of a __finally yet, see the FIXME
in the test. clang also currently crashes on codegen for a jump out of a
__finally block, see PR22414 comment 7.

I also added a few tests for the interaction of indirect jumps and SEH blocks.
MSVC doesn't support indirect jumps, so there's no way to know if clang behave
the same way as msvc here.  clang's behavior with this patch does make sense
to me, but maybe it could be argued that it should be more permissive (see
FIXME in the indirect jump tests -- shout if you have an opinion on this).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227982 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/DiagnosticSemaKinds.td
lib/Sema/JumpDiagnostics.cpp
test/SemaCXX/scope-check.cpp