On Wed, Jul 16, 2025 at 09:22:19PM +0000, Qing Zhao wrote: > Yes, the above solution could also resolve the undefined behavior issue. We > can certainly go > with this approach.
Another option is to use .ACCESS_WITH_SIZE (with different flags compared to the FAM cases) solely on reads from the pointer, and then objsz pass taking the indirection into account. I.e. when you see some pointer dereferenced and the pointer originates in .ACCESS_WITH_SIZE with that flag, take it as size of what the pointer points at rather than the FAM way. Still, .ACCESS_WITH_SIZE first argument should be the pointer value, not its address, and you should never instrument stores to the pointer, only reads from it. So, f->p = whatever; doesn't get .ACCESS_WITH_SIZE, _1 = f->p; gets it and then f->p[a] is _2 = _1 p+ off; MEM_REF[_2] opr similar. Jakub