Give struct vpi_ref a magic

to be able to use our standard miniobj facilities on it, PAN_dump_struct
in this case.

As vpi_ref is static const in VGC, there is no real reason for magic
checks other than that.
parent 21eb6a17
......@@ -46,6 +46,8 @@ void v_noreturn_ VPI_Fail(const char *func, const char *file, int line,
*/
struct vpi_ref {
unsigned magic;
#define VPI_REF_MAGIC 0xd955f567
unsigned source;
unsigned offset;
unsigned line;
......
......@@ -410,7 +410,7 @@ EmitCoordinates(const struct vcc *tl, struct vsb *vsb)
pos++;
}
VSB_printf(vsb, " [%3u] = { %u, %8tu, %4u, %3u, ",
VSB_printf(vsb, " [%3u] = { VPI_REF_MAGIC, %u, %8tu, %4u, %3u, ",
t->cnt, sp->idx, t->b - sp->b, lin, pos + 1);
if (t->tok == CSRC)
VSB_cat(vsb, " \"C{\"},\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment