mirror of
https://github.com/github/codeql.git
synced 2026-05-01 19:55:15 +02:00
C++: Remove NoThrowAllocator and inline its (corrected) definition in ThrowingAllocator.
This commit is contained in:
@@ -147,19 +147,14 @@ predicate exprMayThrow(Expr e) {
|
||||
)
|
||||
}
|
||||
|
||||
/** An allocator that will not throw an exception. */
|
||||
class NoThrowAllocator extends Function {
|
||||
NoThrowAllocator() {
|
||||
exists(NewOrNewArrayExpr newExpr |
|
||||
newExpr.getAllocator() = this and
|
||||
not functionMayThrow(this)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/** An allocator that might throw an exception. */
|
||||
class ThrowingAllocator extends Function {
|
||||
ThrowingAllocator() { not this instanceof NoThrowAllocator }
|
||||
ThrowingAllocator() {
|
||||
exists(NewOrNewArrayExpr newExpr |
|
||||
newExpr.getAllocator() = this and
|
||||
functionMayThrow(this)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/** The `std::bad_alloc` exception and its `bsl` variant. */
|
||||
|
||||
Reference in New Issue
Block a user