Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit af1da1e

Browse filesBrowse files
committed
C++: Also support the __noreturn__ attribute in exits
Observed this attribute while working on coding standards test regression when replacing Guards by IRGuards.
1 parent 1bc6f88 commit af1da1e
Copy full SHA for af1da1e

File tree

1 file changed

+5
-4
lines changed
Filter options

1 file changed

+5
-4
lines changed

‎cpp/ql/lib/DefaultOptions.qll

Copy file name to clipboardExpand all lines: cpp/ql/lib/DefaultOptions.qll
+5-4Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,13 @@ class Options extends string {
5252
/**
5353
* Holds if a call to this function will never return.
5454
*
55-
* By default, this holds for `exit`, `_exit`, `abort`, `__assert_fail`,
56-
* `longjmp`, `__builtin_unreachable` and any function with a
57-
* `noreturn` attribute or specifier.
55+
* By default, this holds for `exit`, `_exit`, `_Exit`, `abort`,
56+
* `__assert_fail`, `longjmp`, `__builtin_unreachable` and any
57+
* function with a `noreturn` or `__noreturn__` attribute or
58+
* `noreturn` specifier.
5859
*/
5960
predicate exits(Function f) {
60-
f.getAnAttribute().hasName("noreturn")
61+
f.getAnAttribute().hasName(["noreturn", "__noreturn__"])
6162
or
6263
f.getASpecifier().hasName("noreturn")
6364
or

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.