fix unpaired copy-ctor/op= reported by PVS-Stydio
For #192. * bin/common_trans.cc, bin/common_trans.hh, spot/twa/acc.hh: Add an operator= in addition to the copy constructor. * spot/twaalgos/ltl2tgba_fm.cc: Use the default constructor. * spot/ta/taproduct.cc, spot/ta/taproduct.hh: Delete an unused copy constructor.
This commit is contained in:
parent
63818a3e69
commit
d0112a7b8a
6 changed files with 27 additions and 17 deletions
|
|
@ -133,10 +133,22 @@ translator_spec::translator_spec(const char* spec)
|
|||
translator_spec::translator_spec(const translator_spec& other)
|
||||
: spec(other.spec), cmd(other.cmd), name(other.name)
|
||||
{
|
||||
if (name != spec)
|
||||
name = strdup(name);
|
||||
if (cmd != spec)
|
||||
cmd = strdup(cmd);
|
||||
if (name != spec)
|
||||
name = strdup(name);
|
||||
}
|
||||
|
||||
translator_spec& translator_spec::operator=(const translator_spec& other)
|
||||
{
|
||||
spec = other.spec;
|
||||
cmd = other.cmd;
|
||||
if (cmd != spec)
|
||||
cmd = strdup(cmd);
|
||||
name = other.name;
|
||||
if (name != spec)
|
||||
name = strdup(name);
|
||||
return *this;
|
||||
}
|
||||
|
||||
translator_spec::~translator_spec()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue