You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
lib/speller-c.cpp:
extern "C" int aspell_speller_store_replacement(...)
{
[...]
PosibErr ret = ths->store_replacement(...);
[...]
return ret.data;
}
modules/speller/default/speller_impl.hpp:
class SpellerImpl [...]
PosibErr store_replacement([...]);
common/posib_err.hpp:
template
class PosibErr : public PosibErrBase
{
PosibErr(const PosibErrBase & other)
: PosibErrBase(other) {}
PosibErr(const PosibErr<void> & other)
: PosibErrBase(other) {}
Ret data;
};
static const PosibErr no_err;
So, both of these constructors (one of which is used in the implicit conversion of the result of SpellerImpl::store_replacement) leave data unset, and aspell_speller_store_replacement returns ret.data in case of success.
I don't know the supposed semantics, i.e. which function is at fault here, but initializing data should fix the problem:
Though I wonder if these conversions make sense at all. PosibErr is about reliable error handling, but shouldn't it also ensure reliable result handling, not converting "void" to any type without even a warning?
The text was updated successfully, but these errors were encountered:
Using aspell-0.60.8 on GNU/Linux amd64
I traced it to this:
lib/speller-c.cpp:
extern "C" int aspell_speller_store_replacement(...)
{
[...]
PosibErr ret = ths->store_replacement(...);
[...]
return ret.data;
}
modules/speller/default/speller_impl.hpp:
class SpellerImpl [...]
PosibErr store_replacement([...]);
common/posib_err.hpp:
template
class PosibErr : public PosibErrBase
{
PosibErr(const PosibErrBase & other)
: PosibErrBase(other) {}
};
static const PosibErr no_err;
So, both of these constructors (one of which is used in the implicit conversion of the result of SpellerImpl::store_replacement) leave data unset, and aspell_speller_store_replacement returns ret.data in case of success.
I don't know the supposed semantics, i.e. which function is at fault here, but initializing data should fix the problem:
Though I wonder if these conversions make sense at all. PosibErr is about reliable error handling, but shouldn't it also ensure reliable result handling, not converting "void" to any type without even a warning?
The text was updated successfully, but these errors were encountered: