Hauptinhalt

Die Übersetzung dieser Seite ist veraltet. Klicken Sie hier, um die neueste Version auf Englisch zu sehen.

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 wird

Diese Defekte stehen im Zusammenhang mit der C++ Ausnahmenbehandlung. Zu diesen Defekten gehören:

  • Unbehandelte Ausnahme, die von einer noexcept-Funktion ausgeht

  • Unerwartete Ausnahme, die bei der Konstruktion des Argumentobjekts einer throw-Anweisung auftritt

  • catch-Anweisungen, die Ausnahmen nach Wert statt nach Referenz abfangen

  • catch-Anweisungen, die nachfolgende catch-Anweisungen versteckt abfangen

Polyspace-Ergebnisse

Exception caught by valuecatch statement accepts an object by value
Exception handler hidden by previoushandlercatch statement is not reached because of an earlier catch statement for the same exception
Noexcept functionexits with exceptionFunctions 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 exceptionThe argument expression in a throw statement raises unexpected exceptions, leading to resource leaks and security vulnerabilities
UncaughtexceptionAn exception is raised from a function but it is not caught and handled (Seit R2022b)
Throw argumentexpression calls newThe 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.