We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The following code crashes with version 1.10.2:
#include <iostream> #include <ThorSerialize/JsonThor.h> #include <ThorSerialize/SerUtil.h> using namespace ThorsAnvil::Serialize; using namespace std; struct BaseVehicle { std::unique_ptr<bool> isPreloaded { nullptr }; virtual ~BaseVehicle() = default; ThorsAnvil_PolyMorphicSerializer(BaseVehicle); }; ThorsAnvil_MakeTrait(BaseVehicle, isPreloaded); struct Vehicle : public BaseVehicle { std::unique_ptr<int> id { nullptr }; ~Vehicle() override = default; ThorsAnvil_PolyMorphicSerializer(Vehicle); }; ThorsAnvil_ExpandTrait(BaseVehicle, Vehicle, id); struct Fleet { //! The list of vehicles. std::unique_ptr<std::vector<std::unique_ptr<Vehicle>>> vehicles { nullptr }; }; ThorsAnvil_MakeTrait(Fleet, vehicles); int main() { Fleet t {}; string str = R"( {"vehicles":[ { "__type": "Vehicle", "id":0 } ]})"; istringstream stream(str); stream >> ThorsAnvil::Serialize::jsonImport(t); return 0; }
I get a EXC_BAD_ACCESS in line 280 of Serialize.tpp: https://github.com/Loki-Astari/ThorsSerializer/blob/master/src/Serialize/Serialize.tpp#L280
EXC_BAD_ACCESS
object->parsePolyMorphicObject(parent, parser);
The text was updated successfully, but these errors were encountered:
Taking a look.
Sorry, something went wrong.
OK. I hove found the issue. Its around the conversion from T* to std::unique_ptr<T>. I will see if I can create a fix tonight.
T*
std::unique_ptr<T>
Sorry it took so long. Have a fixed checked in. The test is here
Brew is build the new version.
No branches or pull requests
The following code crashes with version 1.10.2:
I get a
EXC_BAD_ACCESS
in line 280 of Serialize.tpp: https://github.com/Loki-Astari/ThorsSerializer/blob/master/src/Serialize/Serialize.tpp#L280object->parsePolyMorphicObject(parent, parser);
The text was updated successfully, but these errors were encountered: