dtoc: Fix widening of int to bytes

At present an integer is converted to bytes incorrectly. The whole 32-bit
integer is inserted as the first element of the byte array, and the other
three bytes are skipped. This was not noticed because the unit test did
not check it, and the functional test was checking for wrong values.

Update the code to handle this as a special case. Add one more test to
cover all code paths.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2020-10-03 11:31:27 -06:00
parent abb9cd30b2
commit e144cafe43
5 changed files with 24 additions and 2 deletions

View File

@@ -20,7 +20,7 @@ byte 08
bytearray 01 23 34
int 3
intarray 5 0 0 0
longbytearray 09 00 00 00 00 00 00 00 00
longbytearray 09 0a 0b 0c 00 00 00 00 00
string message2
stringarray "another" "multi-word" "message"
of-platdata probe: