Commit 26e94b77 authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz
Browse files

taproduct: fix incorrect assert() flagged by PVS-Studio

For #192.

* spot/ta/taproduct.cc: Check the output of down_cast, not its input.
parent d0112a7b
......@@ -297,9 +297,8 @@ namespace spot
ta_succ_iterator_product*
ta_product::succ_iter(const state* s) const
{
const state_ta_product* stp = down_cast<const state_ta_product*> (s);
assert(s);
const state_ta_product* stp = down_cast<const state_ta_product*>(s);
assert(stp);
return new ta_succ_iterator_product(stp, ta_.get(), kripke_.get());
}
......@@ -307,8 +306,8 @@ namespace spot
ta_succ_iterator_product*
ta_product::succ_iter(const spot::state* s, bdd changeset) const
{
const state_ta_product* stp = down_cast<const state_ta_product*> (s);
assert(s);
const state_ta_product* stp = down_cast<const state_ta_product*>(s);
assert(stp);
return new ta_succ_iterator_product_by_changeset(stp,
ta_.get(), kripke_.get(),
changeset);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment