mtag: fix get_mtag() for recorded states and for arrays
In the original code, get_mtag() only worked for toplevel_mtags(). We're
passing the mtags around and calculating them, but they basically weren't
used at all.
The majority of this code is about arrays though. As I commit this now
(I wrote it before Christmas vacation), I'm not positive the details are
correct... But the idea is, whenever you have a pointer then you have a
corresponding mtag. So if you have an array of pointers then each element
in the array gets an mtag. But what if you have an array of int and you
do &foo[4]? Then probably the foo array should have an mtag and we use an
offset off that.
But anyway, my test case was an array of pointer and I wanted to give each
element an mtag so I hash the base mtag and the offset to generate it.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>