> On Mon, Nov 16, 2026 at 10:17 AM Jan Hubicka <[email protected]> wrote:
> >
> > Hi,
> > This patch adds EAF_POINTER_ADJUST which records that the function takes
> > pointer by refernece and adjusts it.  This is needed to analyze
> > diplay_impl in cppcheck which needs to be inlined into match and does
> > precisely this.
> 
> I think EAF_POINTER_ADJUST make sense - you should probably
> document that we expect the pointer to remain pointing to the same
> object or NULL.  (is NULL only allowed when the pointer was formerly
> NULL or do we really allow the pointer to become NULL?)

In the testcase the pointer is either adjusted (POINTER_PLUS) or can
become NULL.  WHat we want to ultimately understand is set of values
that one can get from that pointer.  In this case the pointer either
points to known string constant or NULL. So if read happens and is
defined, it will return character from that string constant.  The string
contains special characters like '%' which are expensive to process but
in many cases of cppcheck the actual string passed is simple and in this
case inlining is an important win.

Thanks,
Honza

Reply via email to