mirror of
https://github.com/frida/tinycc
synced 2024-12-22 21:16:49 +03:00
d8fdd380f3
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.
14 lines
511 B
C
14 lines
511 B
C
/* Various things I encountered while hacking the pre processor */
|
|
#define wrap(x) x
|
|
#define pr_warning(fmt, ...) printk(KERN_WARNING fmt, ##__VA_ARGS__)
|
|
#define pr_warn(x,y) pr_warning(x,y)
|
|
#define net_ratelimited_function(function, ...) function(__VA_ARGS__)
|
|
X1 net_ratelimited_function(pr_warn, "pipapo", bla);
|
|
X2 net_ratelimited_function(wrap(pr_warn), "bla", foo);
|
|
#define two m n
|
|
#define chain4(a,b,c,d) a ## b ## c ## d
|
|
X2 chain4(two,o,p,q)
|
|
X3 chain4(o,two,p,q)
|
|
X4 chain4(o,p,two,q)
|
|
X5 chain4(o,p,q,two)
|