mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-21 14:24:09 +01:00
bolt-gen: fixup subtype nested varsize definition
variable length varsized subtypes were being allocated as structs at not pointers; this fixes that.
This commit is contained in:
parent
39e8e98b49
commit
42251cc5b9
1 changed files with 4 additions and 2 deletions
|
@ -46,14 +46,16 @@ towire_${f.type_obj.name}(${ptr}, ${f.name});
|
|||
towire_${f.type_obj.name}(${ptr}, ${'' if f.type_obj.is_assignable() else '&'}${fieldname});
|
||||
% endif
|
||||
</%def>
|
||||
## Subtype and TLV-msg fromwire_
|
||||
## Subtype and TLV-msg fromwire
|
||||
<%def name="fromwire_subtype_field(fieldname, f, ctx)">\
|
||||
<%
|
||||
type_ = f.type_obj.name
|
||||
typename = f.type_obj.type_name()
|
||||
if f.type_obj.is_varsize():
|
||||
typename += ' *'
|
||||
%>\
|
||||
% if f.is_varlen():
|
||||
${'*' if f.type_obj.is_varsize() else ''}${fieldname} = ${f.len_field} ? tal_arr(${ctx}, ${typename}, ${f.len_field}) : NULL;
|
||||
${fieldname} = ${f.len_field} ? tal_arr(${ctx}, ${typename}, ${f.len_field}) : NULL;
|
||||
% endif
|
||||
% if f.is_array() or f.is_varlen():
|
||||
% if f.type_obj.has_array_helper():
|
||||
|
|
Loading…
Add table
Reference in a new issue