From a5d1f698417dff4e470eb94c38ad6c4e5ebf38ff Mon Sep 17 00:00:00 2001 From: eldritch horrors Date: Sat, 18 May 2024 02:35:34 +0200 Subject: libstore: generatorize protocol serializers this is cursed. deeply and profoundly cursed. under NO CIRCUMSTANCES must protocol serializer helpers be applied to temporaries! doing so will inevitably cause dangling references and cause the entire thing to crash. we need to do this even so to get rid of boost coroutines, and likewise to encapsulate the serializers we suffer today at least a little bit to allow a gradual migration to an actual IPC protocol. (this isn't a problem that's unique to generators. c++ coroutines in general cannot safely take references to arbitrary temporaries since c++ does not have a lifetime system that can make this safe. -sigh-) Change-Id: I2921ba451e04d86798752d140885d3c5cc08e146 --- tests/unit/libstore/common-protocol.cc | 2 +- tests/unit/libstore/protocol.hh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/unit/libstore/common-protocol.cc b/tests/unit/libstore/common-protocol.cc index a820cb1c2..1d25f81c7 100644 --- a/tests/unit/libstore/common-protocol.cc +++ b/tests/unit/libstore/common-protocol.cc @@ -50,7 +50,7 @@ public: auto file = goldenMaster(testStem); StringSink to; - CommonProto::write( + to << CommonProto::write( *store, CommonProto::WriteConn { .to = to }, value); diff --git a/tests/unit/libstore/protocol.hh b/tests/unit/libstore/protocol.hh index f480f4ad1..269c9f7aa 100644 --- a/tests/unit/libstore/protocol.hh +++ b/tests/unit/libstore/protocol.hh @@ -56,7 +56,7 @@ public: auto file = ProtoTest::goldenMaster(testStem); StringSink to; - Proto::write( + to << Proto::write( *LibStoreTest::store, typename Proto::WriteConn {to, version}, value); -- cgit v1.2.3