Contenido principal

La traducción de esta página aún no se ha actualizado a la versión más reciente. Haga clic aquí para ver la última versión en inglés.

Defectos relacionados con excepciones en C++

Defectos relacionados con las excepciones en C++ y su gestión, como una excepción no controlada en una función noexcept o una excepción inesperada generada por una instrucción throw

Estos defectos afectan a la gestión de errores mediante excepciones en C++. Entre estos defectos se incluyen:

  • Excepción no controlada emitida desde una función noexcept

  • Excepción inesperada producida al construir el objeto argumento de una instrucción throw

  • Instrucciones catch que capturan excepciones por valor en lugar de por referencia

  • Instrucciones catch que ocultan instrucciones catch posteriores

Resultados de Polyspace

Exception caught by valuecatch statement accepts an object by value
Exception handler hidden by previous handlercatch statement is not reached because of an earlier catch statement for the same exception
Noexcept function exits 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 raises unexpected exceptionThe argument expression in a throw statement raises unexpected exceptions, leading to resource leaks and security vulnerabilities
Uncaught exceptionAn exception is raised from a function but it is not caught and handled (Desde R2022b)
Throw argument expression 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 (Desde R2023b)

Temas

  • Bug Finder Defect Groups

    The Bug Finder defect checkers are classified into groups such as data flow, concurrency, numerical, and so on.