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

For #192.

* spot/ta/taproduct.cc: Check the output of down_cast, not its input.
This commit is contained in:
Alexandre Duret-Lutz 2016-10-28 22:43:54 +02:00
parent d0112a7b8a
commit 26e94b774f

View file

@ -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);