SegmentCommand.create
does not properly create a segment command with a non-zero number of sections
#7428
Labels
SegmentCommand.create
does not properly create a segment command with a non-zero number of sections
#7428
Describe the bug
A clear and concise description of the bug.
To Reproduce
Use the
SegmentCommand.create
method and pass a non-zero value to thenumSections
argument. The resulting bytes have acmdsize
parameter that does not account for the section definitions.Expected behavior
The resulting bytes have a
cmdsize
parameter that does account for the section definitions.Additional context
As far as I know, each section definition is of a guaranteed size, so it should be trivial to multiply that size by the number of sections and add it to the total size. The sections may not be included in the returned bytes, but at least the
cmdsize
parameter will be more accurate. The function could include null bytes of the correct size, if need be. At worst, it can throw if a non-zero value is passed to thenumSections
argument.I understand this is a new-ish method, but is quite helpful for some work that I am doing. I am, however, having to manually re-do the
cmdsize
parameter afterwards and would prefer to not have to do that.The text was updated successfully, but these errors were encountered: