Grant Likely 706b78f37f dtc: ensure #line directives don't consume data from the next line
Previously, the #line parsing regex ended with ({WS}+[0-9]+)?. The {WS}
could match line-break characters. If the #line directive did not contain
the optional flags field at the end, this could cause any integer data on
the next line to be consumed as part of the #line directive parsing. This
could cause syntax errors (i.e. #line parsing consuming the leading 0
from a hex literal 0x1234, leaving x1234 to be parsed as cell data,
which is a syntax error), or invalid compilation results (i.e. simply
consuming literal 1234 as part of the #line processing, thus removing it
from the cell data).

Fix this by replacing {WS} with [ \t] so that it can't match line-breaks.

Convert all instances of {WS}, even though the other instances should be
irrelevant for any well-formed #line directive. This is done for
consistency and ultimate safety.

[Cherry picked from DTC commit a1ee6f068e1c8dbc62873645037a353d7852d5cc]

Reported-by: Ian Campbell <Ian.Campbell@citrix.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2013-06-13 22:12:15 +01:00
..
2005-04-16 15:20:36 -07:00
2011-03-31 11:26:23 -03:00
2011-05-19 15:59:38 -07:00
2005-04-16 15:20:36 -07:00
2008-07-25 22:12:41 +02:00
2011-06-16 20:40:03 +02:00
2011-08-31 16:12:17 +02:00
2012-10-03 09:03:24 +02:00
2012-06-27 12:44:29 -07:00
2010-03-23 12:26:38 +01:00
2013-04-08 11:47:41 +02:00
2013-03-15 15:09:43 +10:30
2008-04-25 20:18:48 +02:00
2012-07-20 10:36:05 +02:00
2005-04-16 15:20:36 -07:00
2013-03-02 20:09:55 +00:00
2009-06-09 22:37:54 +02:00