From 450e0145587c3ac0370428ecb7cd70ca1c3b2ea4 Mon Sep 17 00:00:00 2001 From: Piotr Sarna Date: Fri, 8 Jun 2018 16:41:22 +0200 Subject: [PATCH] idl: remove for_each from fragmented serialization Previously fragmented buffers of bytes were serialized with a for_each loop. Since serializing bytes involves writing size first and then data, only first fragment (and its size) would be taken into account. This commit changes fragmented code generation so it expects that serialized range has a serialize(output, T) specification and expects it to iterate over fragments on its own (just like serializer for basic_value_view does). Fixes #3501 --- idl-compiler.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/idl-compiler.py b/idl-compiler.py index d5cb12ba49..4c912a43bc 100755 --- a/idl-compiler.py +++ b/idl-compiler.py @@ -439,10 +439,7 @@ def add_param_writer_basic_type(name, base_state, typ, var_type = "", var_index GCC6_CONCEPT(requires FragmentRange) after_${base_state}__$name write_fragmented_$name$var_type(FragmentedBuffer&& fragments) && { $set_varient_index - using boost::range::for_each; - for_each(fragments, [&] ($typ t) { - serialize(_out, t); - }); + serialize_fragmented(_out, std::forward(fragments)); $set_command return $return_command; }""")).substitute(locals())