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 {
7272 }
7373
7474 /**
75- * Holds if `(std::nothrow)` exists in call `operator new`.
75+ * Holds if `(std::nothrow)` or `(std::noexcept)` exists in call `operator new`.
7676 */
77- predicate isExistsNothrow ( ) { this . getAChild ( ) .toString ( ) = "nothrow" }
77+ predicate isExistsNothrow ( ) { getTarget ( ) .isNoExcept ( ) or getTarget ( ) . isNoThrow ( ) }
7878}
7979
8080from WrongCheckErrorOperatorNew op
Original file line number Diff line number Diff line change @@ -14,8 +14,8 @@ using namespace std;
1414
1515void * operator new (std::size_t _Size);
1616void * 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 ;
1919
2020void badNew_0_0 ()
2121{
You can’t perform that action at this time.
0 commit comments