C++: Make sure a CatchBlock that catches a const std::bad_alloc& is also a BadAllocCatchBlock.

This commit is contained in:
Mathias Vorreiter Pedersen
2021-05-06 14:35:27 +02:00
parent 42b8f923be
commit 95e65dec8f

View File

@@ -139,7 +139,8 @@ class BadAllocType extends Class {
*/
class BadAllocCatchBlock extends CatchBlock {
BadAllocCatchBlock() {
this.getParameter().getUnspecifiedType() = any(BadAllocType badAlloc).getADerivedClass*()
this.getParameter().getUnspecifiedType().stripType() =
any(BadAllocType badAlloc).getADerivedClass*()
or
not exists(this.getParameter())
}