This is perfectly fine:
for (loc = t->base.loc; loc; loc = loc->next)
{
- p = tmp_p;
+ const char *q;
+
+ q = tmp_p;
- exp = parse_exp_1 (&p, loc->address,
+ exp = parse_exp_1 (&q, loc->address,
block_for_pc (loc->address), 1);
+ p = (char *) q;
It's perfectly valid, as we know Q on output must point within
the object/string TMP_P pointed at on entry.
This reads much more intuitively to me, no funny arithmetic, and
gets rid of the aliasing issue with the other suggestion, and
no new function necessary.