Skip to content

Commit f0d4694

Browse files
committed
Convert ThrowingOperatorNewReturnsNull to the new dataflow library
1 parent 3287062 commit f0d4694

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

cpp/common/src/codingstandards/cpp/rules/throwingoperatornewreturnsnull/ThrowingOperatorNewReturnsNull.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*/
55

66
import cpp
7-
import semmle.code.cpp.dataflow.DataFlow
7+
import semmle.code.cpp.dataflow.new.DataFlow
88
import codingstandards.cpp.allocations.CustomOperatorNewDelete
99
import codingstandards.cpp.exceptions.ExceptionSpecifications
1010
import codingstandards.cpp.Customizations

cpp/common/test/rules/throwingoperatornewreturnsnull/ThrowingOperatorNewReturnsNull.expected

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,16 @@ problems
33
| test.cpp:12:5:12:19 | return ... | test.cpp:12:12:12:18 | 0 | test.cpp:12:12:12:18 | 0 | operator new(size_t) may return null instead of throwing a std::bad_alloc exception. |
44
| test.cpp:14:5:14:33 | return ... | test.cpp:4:10:4:23 | call to operator new | test.cpp:14:12:14:26 | call to can_return_null | operator new(size_t) may return null instead of throwing a std::bad_alloc exception. |
55
edges
6-
| test.cpp:4:10:4:23 | call to operator new | test.cpp:14:12:14:26 | call to can_return_null | provenance | |
6+
| test.cpp:3:7:3:21 | *can_return_null | test.cpp:14:12:14:26 | call to can_return_null | provenance | |
7+
| test.cpp:4:10:4:23 | call to operator new | test.cpp:3:7:3:21 | *can_return_null | provenance | |
8+
| test.cpp:4:10:4:23 | call to operator new | test.cpp:4:10:4:23 | call to operator new | provenance | |
9+
| test.cpp:8:23:8:23 | 0 | test.cpp:8:23:8:23 | 0 | provenance | |
710
| test.cpp:8:23:8:23 | 0 | test.cpp:10:12:10:24 | localVariable | provenance | |
811
nodes
12+
| test.cpp:3:7:3:21 | *can_return_null | semmle.label | *can_return_null |
913
| test.cpp:4:10:4:23 | call to operator new | semmle.label | call to operator new |
14+
| test.cpp:4:10:4:23 | call to operator new | semmle.label | call to operator new |
15+
| test.cpp:8:23:8:23 | 0 | semmle.label | 0 |
1016
| test.cpp:8:23:8:23 | 0 | semmle.label | 0 |
1117
| test.cpp:10:12:10:24 | localVariable | semmle.label | localVariable |
1218
| test.cpp:12:12:12:18 | 0 | semmle.label | 0 |

0 commit comments

Comments
 (0)