mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-17 19:03:42 +01:00
generate-wire.py: add memcheck() to towire functions.
Sanity check that we're not streaming uninitialized bytes. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
c864b28068
commit
bf7fefdc32
@ -251,8 +251,9 @@ class Message(object):
|
||||
print('\ttowire_{}(&p, {});'
|
||||
.format(basetype, f.name))
|
||||
|
||||
# Make sure we haven't encoded any uninitialzied fields!
|
||||
print('\n'
|
||||
'\treturn p;\n'
|
||||
'\treturn memcheck(p, tal_count(p));\n'
|
||||
'}\n')
|
||||
|
||||
parser = OptionParser()
|
||||
@ -274,6 +275,7 @@ if options.output_header:
|
||||
''.format(idem))
|
||||
else:
|
||||
print('#include <{}>\n'
|
||||
'#include <ccan/mem/mem.h>\n'
|
||||
''.format(args[0]))
|
||||
|
||||
# Maps message names to messages
|
||||
|
Loading…
Reference in New Issue
Block a user