mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Merge remote-tracking branch 'origin/topic/jsiwek/coverity-lint'
* origin/topic/jsiwek/coverity-lint: Avoid superfluous string copies when adding to zeek::detail::sig_files Initialize an RD_Decorate member via std::move Fix invalid iterator comparison in UseDefs::FindSuccUsage()
This commit is contained in:
commit
b8ec65ccf7
5 changed files with 15 additions and 4 deletions
11
CHANGES
11
CHANGES
|
@ -1,3 +1,14 @@
|
||||||
|
4.1.0-dev.266 | 2021-02-25 08:45:49 -0700
|
||||||
|
|
||||||
|
* Avoid superfluous string copies when adding to zeek::detail::sig_files
|
||||||
|
|
||||||
|
Coverity 1387015 (Jon Siwek, Corelight)
|
||||||
|
|
||||||
|
* Initialize an RD_Decorate member via std::move (Jon Siwek, Corelight)
|
||||||
|
|
||||||
|
* Fix invalid iterator comparison in UseDefs::FindSuccUsage()
|
||||||
|
|
||||||
|
Coverity 1447018 (Jon Siwek, Corelight)
|
||||||
|
|
||||||
4.1.0-dev.260 | 2021-02-24 15:52:31 -0800
|
4.1.0-dev.260 | 2021-02-24 15:52:31 -0800
|
||||||
|
|
||||||
|
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
||||||
4.1.0-dev.260
|
4.1.0-dev.266
|
||||||
|
|
|
@ -357,7 +357,7 @@ when return TOK_WHEN;
|
||||||
zeek::reporter->Error("failed to find file associated with @load-sigs %s",
|
zeek::reporter->Error("failed to find file associated with @load-sigs %s",
|
||||||
file);
|
file);
|
||||||
else
|
else
|
||||||
zeek::detail::sig_files.push_back(zeek::util::copy_string(path.c_str()));
|
zeek::detail::sig_files.push_back(std::move(path));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0:
|
case 0:
|
||||||
|
|
|
@ -50,7 +50,7 @@ private:
|
||||||
|
|
||||||
class RD_Decorate : public TraversalCallback {
|
class RD_Decorate : public TraversalCallback {
|
||||||
public:
|
public:
|
||||||
RD_Decorate(std::shared_ptr<ProfileFunc> _pf) : pf(_pf)
|
RD_Decorate(std::shared_ptr<ProfileFunc> _pf) : pf(std::move(_pf))
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
// Traverses the given function body, using the first two
|
// Traverses the given function body, using the first two
|
||||||
|
|
|
@ -444,7 +444,7 @@ UDs UseDefs::FindSuccUsage(const Stmt* s) const
|
||||||
auto uds = no_succ ? nullptr : FindUsage(succ->second);
|
auto uds = no_succ ? nullptr : FindUsage(succ->second);
|
||||||
|
|
||||||
auto succ2 = successor2.find(s);
|
auto succ2 = successor2.find(s);
|
||||||
auto no_succ2 = (succ2 == successor.end() || ! succ2->second);
|
auto no_succ2 = (succ2 == successor2.end() || ! succ2->second);
|
||||||
auto uds2 = no_succ2 ? nullptr : FindUsage(succ2->second);
|
auto uds2 = no_succ2 ? nullptr : FindUsage(succ2->second);
|
||||||
|
|
||||||
if ( uds && uds2 )
|
if ( uds && uds2 )
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue