work around spurious gcc 12 "potentially null dereference"
The issue seems to be inside std::vector's copy constructor, but it highlighted places in Spot were we could avoid this copy. * spot/twaalgos/ltl2taa.cc: Avoid some copies of std::vector<formula>.
This commit is contained in:
parent
eecb9af21e
commit
10bc253dd8
1 changed files with 6 additions and 4 deletions
|
|
@ -61,7 +61,8 @@ namespace spot
|
||||||
{
|
{
|
||||||
std::vector<formula> empty;
|
std::vector<formula> empty;
|
||||||
res_->create_transition(init_, empty);
|
res_->create_transition(init_, empty);
|
||||||
succ_state ss = { empty, f, empty };
|
succ_state ss;
|
||||||
|
ss.condition = f;
|
||||||
succ_.emplace_back(ss);
|
succ_.emplace_back(ss);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -76,7 +77,8 @@ namespace spot
|
||||||
std::vector<formula> empty;
|
std::vector<formula> empty;
|
||||||
taa_tgba::transition* t = res_->create_transition(init_, empty);
|
taa_tgba::transition* t = res_->create_transition(init_, empty);
|
||||||
res_->add_condition(t, f);
|
res_->add_condition(t, f);
|
||||||
succ_state ss = { empty, f, empty };
|
succ_state ss;
|
||||||
|
ss.condition = f;
|
||||||
succ_.emplace_back(ss);
|
succ_.emplace_back(ss);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -90,7 +92,7 @@ namespace spot
|
||||||
return;
|
return;
|
||||||
dst.emplace_back(v.init_);
|
dst.emplace_back(v.init_);
|
||||||
res_->create_transition(init_, dst);
|
res_->create_transition(init_, dst);
|
||||||
succ_state ss = { dst, formula::tt(), a };
|
succ_state ss = { std::move(dst), formula::tt(), std::move(a) };
|
||||||
succ_.emplace_back(ss);
|
succ_.emplace_back(ss);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -206,7 +208,7 @@ namespace spot
|
||||||
}
|
}
|
||||||
t = res_->create_transition(init_, u);
|
t = res_->create_transition(init_, u);
|
||||||
res_->add_condition(t, f);
|
res_->add_condition(t, f);
|
||||||
succ_state ss = { u, f, a };
|
succ_state ss = { std::move(u), f, std::move(a) };
|
||||||
succ_.emplace_back(ss);
|
succ_.emplace_back(ss);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue