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) {
147147 )
148148}
149149
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 ( ) {
153153 exists ( NewOrNewArrayExpr newExpr |
154154 newExpr .getAllocator ( ) = this and
155- not functionMayThrow ( this )
155+ functionMayThrow ( this )
156156 )
157157 }
158158}
159159
160- /** An allocator that might throw an exception. */
161- class ThrowingAllocator extends Function {
162- ThrowingAllocator ( ) { not this instanceof NoThrowAllocator }
163- }
164-
165160/** The `std::bad_alloc` exception and its `bsl` variant. */
166161class BadAllocType extends Class {
167162 BadAllocType ( ) { this .hasGlobalOrStdOrBslName ( "bad_alloc" ) }
You can’t perform that action at this time.
0 commit comments