New Defects reported by Coverity Scan for llvm

Hi,

Please find the latest report on new defect(s) introduced to llvm found with Coverity Scan.

2 new defect(s) introduced to llvm found with Coverity Scan.

New defect(s) Reported-by: Coverity Scan
Showing 2 of 2 defect(s)

** CID 1505996: Incorrect expression (COPY_PASTE_ERROR)
/flang/lib/Semantics/check-declarations.cpp: 1391 in Fortran::semantics::CheckHelper::CheckSpecifics(const Fortran::semantics::Symbol &, const Fortran::semantics::GenericDetails &)()


*** CID 1505996: Incorrect expression (COPY_PASTE_ERROR)
/flang/lib/Semantics/check-declarations.cpp: 1391 in Fortran::semantics::CheckHelper::CheckSpecifics(const Fortran::semantics::Symbol &, const Fortran::semantics::GenericDetails &)()
1385 generic.name(), specific.name())}) {
1386 msg->Attach(
1387 specific.name(), “Definition of ‘%s’”_en_US, specific.name());
1388 }
1389 continue;
1390 }

CID 1505996:  Incorrect expression  (COPY_PASTE_ERROR)
"specific" in "specific->attrs()" looks like a copy-paste error.

1391 if (specific.attrs().test(Attr::INTRINSIC)) {
1392 if (auto *msg{messages_.Say(specific.name(),
1393 “Specific procedure ‘%s’ of generic interface ‘%s’ may not be INTRINSIC”_err_en_US,
1394 specific.name(), generic.name())}) {
1395 msg->Attach(generic.name(), “Definition of ‘%s’”_en_US, generic.name());
1396 }

** CID 1505995: Error handling issues (CHECKED_RETURN)
/flang/lib/Semantics/resolve-names.cpp: 5507 in Fortran::semantics::DeclarationVisitor::Pre(const Fortran::parser::CommonStmt::Block &)()


*** CID 1505995: Error handling issues (CHECKED_RETURN)
/flang/lib/Semantics/resolve-names.cpp: 5507 in Fortran::semantics::DeclarationVisitor::Pre(const Fortran::parser::CommonStmt::Block &)()
5501 }
5502 }
5503 return true;
5504 }
5505
5506 bool DeclarationVisitor::Pre(const parser::CommonStmt::Block &x) {

CID 1505995:  Error handling issues  (CHECKED_RETURN)
Calling "CheckNotInBlock" without checking return value (as is done elsewhere 6 out of 7 times).

5507 CheckNotInBlock(“COMMON”); // C1107
5508 return true;
5509 }
5510
5511 bool DeclarationVisitor::Pre(const parser::CommonBlockObject &) {
5512 BeginArraySpec();


To view the defects in Coverity Scan visit, Coverity Scan - Sign in