tccpp: Fix corner case
commitd8fdd380f39aa413886c61c2e3624ba3b4582dc0
authorMichael Matz <matz@suse.de>
Sun, 9 Jul 2017 02:30:36 +0000 (9 04:30 +0200)
committerMichael Matz <matz@suse.de>
Sun, 9 Jul 2017 02:38:56 +0000 (9 04:38 +0200)
tree8f17b9c9e34ae77aafd5ce37fee68f50a6523dcb
parent16d3dbf2d087c92810d8d8354822a5345978e32c
tccpp: Fix corner case

See added testcase 19.c from a bug report.  The problem is reading outside
the arguments buffers, even though we aren't allowed to.  The single
can_read_stream variable is not enough, sometimes we need to be able
to pop into outer contexts but not into arbitrarily outside contexts.

The trick is to terminate argument tokens with a EOF (and not just with
0 that makes us pop contexts), and deal with that in the few places
we have to,

This enables some cleanups of the can_read_stream variable use.
tccpp.c
tests/pp/19.c [new file with mode: 0644]
tests/pp/19.expect [new file with mode: 0644]
tests/pp/20.c [new file with mode: 0644]
tests/pp/20.expect [new file with mode: 0644]
tests/pp/Makefile