Message ID | 1370020450-18136-1-git-send-email-swarren@wwwdotorg.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Stephen Warren <swarren@wwwdotorg.org> writes:
> Fix this by replacing {WS} with [ \t] so that it can't match line-breaks.
I think the other uses of {WS} shouldn't span lines either.
Andreas.
On 05/31/2013 11:38 AM, Andreas Schwab wrote: > Stephen Warren <swarren@wwwdotorg.org> writes: > >> Fix this by replacing {WS} with [ \t] so that it can't match line-breaks. > > I think the other uses of {WS} shouldn't span lines either. That is true, but only the optional occurrence /should/ matter. Any changes to the other occurrences would only affect malformed #line directives, whereas changing this one occurrence would also affect well-formed #line directives, due to the optional nature of the trailing flags field. Still, it may be reasonable just to change all the occurrences anyway. Does anyone have a strong opinion either way? -- To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/dtc-lexer.l b/dtc-lexer.l index 254d5af..a3a4c69 100644 --- a/dtc-lexer.l +++ b/dtc-lexer.l @@ -71,7 +71,7 @@ static int pop_input_file(void); push_input_file(name); } -<*>^"#"(line)?{WS}+[0-9]+{WS}+{STRING}({WS}+[0-9]+)? { +<*>^"#"(line)?{WS}+[0-9]+{WS}+{STRING}([ \t]+[0-9]+)? { char *line, *tmp, *fn; /* skip text before line # */ line = yytext; diff --git a/tests/line_directives.dts b/tests/line_directives.dts index e9d0800..046ef37 100644 --- a/tests/line_directives.dts +++ b/tests/line_directives.dts @@ -8,4 +8,14 @@ # 6 "bar.dts" / { +/* + * Make sure optional flags don't consume integer data on next line. The issue + * was that the {WS} in the trailing ({WS}+[0-9]+)? could cross the * line- + * break, and consume the leading "0" of the hex constant, leaving "x12345678" + * to be parsed as a number, which is invalid syntax. + */ + prop1 = < +# 10 "qux.dts" + 0x12345678 + >; };