File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
src/experimental/Security/CWE/CWE-570
test/experimental/query-tests/Security/CWE/CWE-570/semmle/tests Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -72,9 +72,9 @@ class WrongCheckErrorOperatorNew extends FunctionCall {
72
72
}
73
73
74
74
/**
75
- * Holds if `(std::nothrow)` exists in call `operator new`.
75
+ * Holds if `(std::nothrow)` or `(std::noexcept)` exists in call `operator new`.
76
76
*/
77
- predicate isExistsNothrow ( ) { this . getAChild ( ) .toString ( ) = "nothrow" }
77
+ predicate isExistsNothrow ( ) { getTarget ( ) .isNoExcept ( ) or getTarget ( ) . isNoThrow ( ) }
78
78
}
79
79
80
80
from WrongCheckErrorOperatorNew op
Original file line number Diff line number Diff line change @@ -14,8 +14,8 @@ using namespace std;
14
14
15
15
void * operator new (std::size_t _Size);
16
16
void * operator new [](std::size_t _Size);
17
- void * operator new ( std::size_t count, const std::nothrow_t & tag );
18
- void * operator new []( std::size_t count, const std::nothrow_t & tag );
17
+ void * operator new ( std::size_t count, const std::nothrow_t & tag ) noexcept ;
18
+ void * operator new []( std::size_t count, const std::nothrow_t & tag ) noexcept ;
19
19
20
20
void badNew_0_0 ()
21
21
{
You can’t perform that action at this time.
0 commit comments