メインコンテンツ

このページの内容は最新ではありません。最新版の英語を参照するには、ここをクリックします。

C++ の例外の欠陥

関数 noexcept での未処理例外や throw ステートメントで報告される予期せぬ例外など、C++ 例外およびその処理に関する欠陥

これらの欠陥は C++ 例外処理に関連しています。欠陥には次のものがあります。

  • 関数 noexcept から発生する未処理例外

  • throw ステートメントの引数オブジェクトの構築中に発生する予期せぬ例外

  • 参照ではなく値による例外をキャッチする catch ステートメント

  • 後続の catch ステートメントを隠す catch ステートメント

Polyspace 結果

例外が値によってキャッチされましたcatch ステートメントがオブジェクトを値によって受け取る
前のハンドラーによって隠された例外ハンドラーです同じ例外に対して catch ステートメントが先行しているため、catch ステートメントに到達しない
関数 noexcept が例外で終了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 の引数が予期せぬ例外を発生The argument expression in a throw statement raises unexpected exceptions, leading to resource leaks and security vulnerabilities
キャッチされていない例外An exception is raised from a function but it is not caught and handled (R2022b 以降)
throw の引数式が 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 (R2023b 以降)

トピック

  • Bug Finder 欠陥グループ

    Bug Finder の欠陥チェッカーは、データ フロー、同時実行、数値などのグループに分類されています。