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 referenciaInstrucciones
catch
que ocultan instruccionescatch
posteriores
Resultados de Polyspace
Exception caught by value | catch statement accepts an object by
value |
Exception handler hidden by previous
handler | catch statement is not reached because
of an earlier catch statement for the same exception |
Noexcept function
exits 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 raises
unexpected exception | The argument expression in a throw statement raises unexpected
exceptions, leading to resource leaks and security vulnerabilities |
Uncaught
exception | An exception is raised from a function but it is not caught and handled (Desde R2022b) |
Throw argument
expression 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 (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.