platform_external_dtc/tests/bad-octal-literal.dts
David Gibson 1ab2205a6f Gracefully handle bad octal literals
The code handling integer literals in dtc-lexer.l assumes that the flex
regexp means that strtoull() can't fail to interpret the string as a valid
integer (either decimal, octal, or hexadecimal).  This is not true for
octals.  For example '09' is accepted as a literal by the regexp,
strtoull() attempts to handle it as octal, but it has a bad digit.

This changes the code to give a more useful error in this case.

Reported-by: Anton Blanchard <anton@samba.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2016-01-03 22:54:37 +11:00

5 lines
29 B
Text