Skip to content

Removed definitions of error prone unpack and unpack_from_vector functions

Bartek Wrona requested to merge bw_broken_unpack_elimination into develop

Eliminated wrong and error-prone definitions of unpack and unpack_from_vector functions.

  1. unpack problem - there was definition of unpack method taking a const reference of object to be compared against read object: template<typename Stream, typename T> inline void unpack( Stream& s, const T& vi, uint32_t depth ). Above function has no practical use. .
  2. T unpack_from_vector()T unpack_from_vector( const std::vector& s, uint32_t depth )problem - it contained local tmp variable (of typeT`) which was not initialized. In case of unpacking primitive types, and because of quite strange conditional code, which silently skipps unpack on empty stream (usually it should lead to data read error), it left to returning uninitialized object in some execution paths.
Edited by Bartek Wrona

Merge request reports