cadets / freebsd-old

FreeBSD src tree http://www.FreeBSD.org/
Other
12 stars 7 forks source link

Error inferring types when using constant strings in expressions #153

Closed lc525 closed 2 years ago

lc525 commented 2 years ago

Using expressions like:

this->filename = (struct vnode *)arg1 == NULL ? "unknown" : stringof(((struct vnode *)arg1)->v_cache_dst.tqh_first->nc_name);
printf("filename: %s", this->curpath);

fail with:

otype = 1, type = 0
dt_infer_type(stls, 18): inferring types for r2defs failed
failed to infer a type for 18
dtrace: failed to infer a type for 18

This also fails with the same error if not using stringof(...); the exact definition of nc_name is "char nc_name[0]" (it's at the end of a variable-length struct)