Unicorn with delicious cookie
Nous utilisons des cookies pour améliorer votre expérience de navigation. En savoir plus
Accepter
to the top
>
>
>
Examples of errors detected by the V102…

Examples of errors detected by the V1022 diagnostic

V1022. Exception was thrown by pointer. Consider throwing it by value instead.


LibrePCB

V1022 CWE-755 An exception was thrown by pointer. Consider throwing it by value instead. cmdremoveselectedschematicitems.cpp 143


bool CmdRemoveSelectedSchematicItems::performExecute() {
  ....
  throw new LogicError(__FILE__, __LINE__);
  ....
}

Haiku Operation System

V1022 An exception was thrown by pointer. Consider throwing it by value instead. gensyscallinfos.cpp 316


int
main(int argc, char** argv)
{
  try {
    return Main().Run(argc, argv);
  } catch (Exception& exception) {                                         // <=
    fprintf(stderr, "%s\n", exception.what());
    return 1;
  }
}

int Run(int argc, char** argv)
{
  ....
  _ParseSyscalls(argv[1]);
  ....
}

void _ParseSyscalls(const char* filename)
{
  ifstream file(filename, ifstream::in);
  if (!file.is_open())
    throw new IOException(string("Failed to open `") + filename + "'.");   // <=
  ....
}

Similar errors can be found in some other places:

  • V1022 An exception was thrown by pointer. Consider throwing it by value instead. gensyscallinfos.cpp 347
  • V1022 An exception was thrown by pointer. Consider throwing it by value instead. gensyscallinfos.cpp 413

FaCT++

V1022 [CWE-755] An exception was thrown by pointer. Consider throwing it by value instead. ExtendedDataRange.cpp 44


static bool
checkDataRelation ( const DataTypeReasoner& Op1,
                    const DataTypeReasoner& Op2, int op )
{
  switch (op)
  {
  ....
  default:
    throw new EFaCTPlusPlus("Illegal operation in checkDataRelation()");
  }
}

Qt Creator

V1022 [CWE-755] An exception was thrown by pointer. Consider throwing it by value instead. celliterator.cpp 59


CellIterator &CellIterator::operator-=(int n)
{
  ....
  if (m_pos - n < 0)
    throw new std::runtime_error("-= n too big!");
}

close form

Remplissez le formulaire ci‑dessous en 2 étapes simples :

Vos coordonnées :

Étape 1
Félicitations ! Voici votre code promo !

Type de licence souhaité :

Étape 2
Team license
Enterprise licence
** En cliquant sur ce bouton, vous déclarez accepter notre politique de confidentialité
close form
Demandez des tarifs
Nouvelle licence
Renouvellement de licence
--Sélectionnez la devise--
USD
EUR
* En cliquant sur ce bouton, vous déclarez accepter notre politique de confidentialité

close form
La licence PVS‑Studio gratuit pour les spécialistes Microsoft MVP
close form
Pour obtenir la licence de votre projet open source, s’il vous plait rempliez ce formulaire
* En cliquant sur ce bouton, vous déclarez accepter notre politique de confidentialité

close form
I want to join the test
* En cliquant sur ce bouton, vous déclarez accepter notre politique de confidentialité

close form
check circle
Votre message a été envoyé.

Nous vous répondrons à


Si l'e-mail n'apparaît pas dans votre boîte de réception, recherchez-le dans l'un des dossiers suivants:

  • Promotion
  • Notifications
  • Spam