mtag: Use extra state to get mtag and offset
commitc221e3ad1f1d5620c79869eee715d181358b7c1a
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 26 Jul 2018 15:39:44 +0000 (26 18:39 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Thu, 26 Jul 2018 15:39:44 +0000 (26 18:39 +0300)
tree24575144a2d024b1272288c437ffce9a6bb33482
parent17b89950a1c1fd10d5de0560031bdd379d403d86
mtag: Use extra state to get mtag and offset

We need to take a look at validation/sm_mtag6.c to really explain what
this code is doing.  We call:

frob2(&aaa.b);

The "aaa" struct is a top level struct.  We know what the mtag sval is for
&aaa.b so we pass that to frob2().  If we built the DB twice then we
would also know the value of "aaa.b" and we would pass that but for this
test we're only passing it once.

So then when we parse frob2() with the DB we know the "value" (meaning
the mtag sval) of "p".  So we look it up and get the value of *p.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
smatch_mtag.c
validation/sm_mtag6.c [new file with mode: 0644]