Commit 8a88ad8b authored by David Gibson's avatar David Gibson Committed by Jon Loeliger
Browse files

dtc: Remove ugly include stack abuse



Currently, dt_from_source() uses push_input_file() to set up the
initial input file for the lexer.  That sounds sensible - put the
outermost input file at the bottom of the stack - until you realise
that what it *actually* does is pushes the current, uninitialized,
lexer input state onto the stack, then sets up the new lexer input.

That necessitates an extra check in pop_input_file(), rather than
signalling termination in the natural way when the include stack is
empty, it has to check when it pops the bogus uninitialized state off
the stack.  Ick.

With that fixed, push_input_file(), pop_input_file() and
incl_file_stack itself become local to the lexer, so make them static.

Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
parent f7ea3708
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment