Re: dissect: teach do_initializer() to handle the nested EXPR_IDENTIFIER's

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



+++ Oleg Nesterov [08/02/16 16:13 +0100]:
do_initializer() is very limited/buggy but it was able to parse the kernel
code until ftrace started to use ".a.b = x" rather than ".a = { .b = x }"
in initializers.

Test-case:

	struct O {
		struct I {
			int mem;
		} inn;
		int end;
	} var = {
		.inn.mem = 0,
		0,
	};

before the patch:

	1:8   s def  O
	2:16  s def  I
	6:3   g def  var                              struct O
	6:3   g -w-  var                              struct O
	7:10  s -w-  O.inn                            struct I
	7:10  s -w-  I.*                              struct I
	I.c:7:14: warning: bad expr->type: 25
	8:9   s -w-  O.end                            int

after:

	1:8   s def  O
	2:16  s def  I
	6:3   g def  var                              struct O
	6:3   g -w-  var                              struct O
	7:10  s -w-  O.inn                            struct I
	7:14  s -w-  I.mem                            int
	8:9   s -w-  O.end                            int

Signed-off-by: Oleg Nesterov <oleg@xxxxxxxxxx>
---
LGTM, builds and test case works as expected.
Acked-by: Lance Richardson <lrichard@xxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux