Defekte bei der C++ Ausnahmenbehandlung
Defekte im Zusammenhang mit C++ Ausnahmen und deren Behandlung, z. B. unbehandelte Ausnahmen in einer
noexcept
-Funktion oder eine unerwartete Ausnahme, die durch eine throw
-Anweisung ausgelöst wirdDiese Defekte stehen im Zusammenhang mit der C++ Ausnahmenbehandlung. Zu diesen Defekten gehören:
Unbehandelte Ausnahme, die von einer
noexcept
-Funktion ausgehtUnerwartete Ausnahme, die bei der Konstruktion des Argumentobjekts einer
throw
-Anweisung auftrittcatch
-Anweisungen, die Ausnahmen nach Wert statt nach Referenz abfangencatch
-Anweisungen, die nachfolgendecatch
-Anweisungen versteckt abfangen
Polyspace-Ergebnisse
Exception caught by value | catch statement accepts an object by
value |
Exception handler hidden by previoushandler | catch statement is not reached because
of an earlier catch statement for the same exception |
Noexcept functionexits with exception | Functions specified as noexcept ,
noexcept(true) or noexcept(<true condition>)
exits with an exception, which causes abnormal termination of program execution, leading to
resource leak and security vulnerability |
Throw argument raisesunexpected exception | The argument expression in a throw statement raises unexpected
exceptions, leading to resource leaks and security vulnerabilities |
Uncaughtexception | An exception is raised from a function but it is not caught and handled (Seit R2022b) |
Throw argumentexpression calls new | The argument expression in a throw statement allocates memory by
calling new , which can result in abrupt termination of the program and
resource leaks (Seit R2023b) |
Themen
- Bug Finder Defect Groups
The Bug Finder defect checkers are classified into groups such as data flow, concurrency, numerical, and so on.