File tree Expand file tree Collapse file tree 1 file changed +4
-9
lines changed
cpp/ql/src/experimental/Security/CWE/CWE-570 Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -147,21 +147,16 @@ predicate exprMayThrow(Expr e) {
147
147
)
148
148
}
149
149
150
- /** An allocator that will not throw an exception. */
151
- class NoThrowAllocator extends Function {
152
- NoThrowAllocator ( ) {
150
+ /** An allocator that might throw an exception. */
151
+ class ThrowingAllocator extends Function {
152
+ ThrowingAllocator ( ) {
153
153
exists ( NewOrNewArrayExpr newExpr |
154
154
newExpr .getAllocator ( ) = this and
155
- not functionMayThrow ( this )
155
+ functionMayThrow ( this )
156
156
)
157
157
}
158
158
}
159
159
160
- /** An allocator that might throw an exception. */
161
- class ThrowingAllocator extends Function {
162
- ThrowingAllocator ( ) { not this instanceof NoThrowAllocator }
163
- }
164
-
165
160
/** The `std::bad_alloc` exception and its `bsl` variant. */
166
161
class BadAllocType extends Class {
167
162
BadAllocType ( ) { this .hasGlobalOrStdOrBslName ( "bad_alloc" ) }
You can’t perform that action at this time.
0 commit comments