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
This commit is contained in:
Piotr Sarna
2018-06-08 16:41:22 +02:00
parent e525a0d51b
commit 450e014558

View File

@@ -439,10 +439,7 @@ def add_param_writer_basic_type(name, base_state, typ, var_type = "", var_index
GCC6_CONCEPT(requires FragmentRange<FragmentedBuffer>)
after_${base_state}__$name<Output> 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<FragmentedBuffer>(fragments));
$set_command
return $return_command;
}""")).substitute(locals())