Re: [PATCH v1 01/12] perf expr: Add has_event function

From: Ian Rogers
Date: Fri Jun 23 2023 - 11:01:23 EST


On Fri, Jun 23, 2023 at 7:40 AM John Garry <john.g.garry@xxxxxxxxxx> wrote:
>
> On 23/06/2023 01:33, Ian Rogers wrote:
> > + if (!compute_ids)
> > + return 0.0;
> > +
> > + tmp = evlist__new();
>
> tmp may be NULL, and parse_event() is not NULL safe, so I assume that we
> need to handle tmp == NULL

I'm not sure there's much sensible we can do with this, so I'll turn
it into a NAN for v2 - the normal error case.

Thanks,
Ian

> > + ret = parse_event(tmp, id) ? 0 : 1;
> > + evlist__delete(tmp);
> > + return ret;
>