work around some g++-7.3 issues
* spot/twaalgos/langmap.cc, spot/ltsmin/ltsmin.cc: Add asserts to hide spurious "potential null pointer dereference" messages. * spot/twaalgos/tau03opt.cc (color_ref): Initialize pc to nullptr even when is_cyan is true so that valgrind does not report pc being used uninitialized in is_white().
This commit is contained in:
parent
a323662e8a
commit
a9bf4dfa58
3 changed files with 6 additions and 1 deletions
|
|
@ -233,6 +233,7 @@ namespace spot
|
||||||
fixed_size_pool* p = static_cast<fixed_size_pool*>(ctx->pool);
|
fixed_size_pool* p = static_cast<fixed_size_pool*>(ctx->pool);
|
||||||
spins_state* out =
|
spins_state* out =
|
||||||
new(p->allocate()) spins_state(ctx->state_size, p);
|
new(p->allocate()) spins_state(ctx->state_size, p);
|
||||||
|
assert(out != nullptr);
|
||||||
memcpy(out->vars, dst, ctx->state_size * sizeof(int));
|
memcpy(out->vars, dst, ctx->state_size * sizeof(int));
|
||||||
out->compute_hash();
|
out->compute_hash();
|
||||||
ctx->transitions.emplace_back(out);
|
ctx->transitions.emplace_back(out);
|
||||||
|
|
@ -250,6 +251,7 @@ namespace spot
|
||||||
- sizeof(spins_compressed_state::vars)
|
- sizeof(spins_compressed_state::vars)
|
||||||
+ sizeof(int) * csize);
|
+ sizeof(int) * csize);
|
||||||
spins_compressed_state* out = new(mem) spins_compressed_state(csize, p);
|
spins_compressed_state* out = new(mem) spins_compressed_state(csize, p);
|
||||||
|
assert(out != nullptr);
|
||||||
memcpy(out->vars, ctx->compressed, csize * sizeof(int));
|
memcpy(out->vars, ctx->compressed, csize * sizeof(int));
|
||||||
out->compute_hash();
|
out->compute_hash();
|
||||||
ctx->transitions.emplace_back(out);
|
ctx->transitions.emplace_back(out);
|
||||||
|
|
@ -710,6 +712,7 @@ namespace spot
|
||||||
+ sizeof(int) * csize);
|
+ sizeof(int) * csize);
|
||||||
spins_compressed_state* res = new(mem)
|
spins_compressed_state* res = new(mem)
|
||||||
spins_compressed_state(csize, p);
|
spins_compressed_state(csize, p);
|
||||||
|
assert(res != nullptr);
|
||||||
memcpy(res->vars, compressed_, csize * sizeof(int));
|
memcpy(res->vars, compressed_, csize * sizeof(int));
|
||||||
res->compute_hash();
|
res->compute_hash();
|
||||||
return res;
|
return res;
|
||||||
|
|
@ -718,6 +721,7 @@ namespace spot
|
||||||
{
|
{
|
||||||
fixed_size_pool* p = const_cast<fixed_size_pool*>(&statepool_);
|
fixed_size_pool* p = const_cast<fixed_size_pool*>(&statepool_);
|
||||||
spins_state* res = new(p->allocate()) spins_state(state_size_, p);
|
spins_state* res = new(p->allocate()) spins_state(state_size_, p);
|
||||||
|
assert(res != nullptr);
|
||||||
d_->get_initial_state(res->vars);
|
d_->get_initial_state(res->vars);
|
||||||
res->compute_hash();
|
res->compute_hash();
|
||||||
return res;
|
return res;
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,7 @@ namespace spot
|
||||||
for (unsigned i = 0; i < n_states; ++i)
|
for (unsigned i = 0; i < n_states; ++i)
|
||||||
{
|
{
|
||||||
twa_graph_ptr c = make_twa_graph(aut, twa::prop_set::all());
|
twa_graph_ptr c = make_twa_graph(aut, twa::prop_set::all());
|
||||||
|
assert(c); // for some reason g++ 7.3 thinks this could be null
|
||||||
c->set_init_state(i);
|
c->set_init_state(i);
|
||||||
alt_init_st_auts[i] = c;
|
alt_init_st_auts[i] = c;
|
||||||
compl_alt_init_st_auts[i] = remove_fin(dualize(c));
|
compl_alt_init_st_auts[i] = remove_fin(dualize(c));
|
||||||
|
|
|
||||||
|
|
@ -407,7 +407,7 @@ namespace spot
|
||||||
public:
|
public:
|
||||||
color_ref(hash_type* h, hcyan_type* hc, const state* s,
|
color_ref(hash_type* h, hcyan_type* hc, const state* s,
|
||||||
const weight* w, acc_cond::mark_t* a)
|
const weight* w, acc_cond::mark_t* a)
|
||||||
: is_cyan(true), w(w), ph(h), phc(hc), ps(s), acc(a)
|
: is_cyan(true), w(w), ph(h), phc(hc), ps(s), pc(nullptr), acc(a)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
color_ref(color* c, acc_cond::mark_t* a)
|
color_ref(color* c, acc_cond::mark_t* a)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue