Revert "Fixed a bug in FLANN resulting in uninitialized accesses."

This reverts commit a9975b144a, to prepare
for cherry-picking upstream's solution.
This commit is contained in:
Roman Donchenko 2013-10-02 16:02:11 +04:00
parent 60bcc52c4f
commit 78c4ffec99

View File

@ -257,7 +257,8 @@ public:
const T& cast() const
{
if (policy->type() != typeid(T)) throw anyimpl::bad_any_cast();
T* r = reinterpret_cast<T*>(policy->get_value(const_cast<void **>(&object)));
void* obj = const_cast<void*>(object);
T* r = reinterpret_cast<T*>(policy->get_value(&obj));
return *r;
}