Re: [RFA/Ada(v2) 1/3] Add command to list Ada exceptions

Joel Brobecker
2013-11-08T15:47:25Z

> Joel> + if (regexp != NULL)
> Joel> + {
> Joel> + preg = alloca (sizeof (regex_t));
>
> I think regex_t is sufficiently small that you might as well declare an
> object in the outer scope and avoid alloca.

Sure, I can do that. I found this to be a fairly interesting
approach, because it avoids the need to check regexp repeatedly
in order to decide whether to pass &preg, or NULL.

> Joel> + discard_cleanups (old_chain);
>
> This leaks anything done by compile_rx_or_error. I think you need to
> pass an inner cleanup to do_cleanups.

Oops. I will fix!

Thank you :)
--
Joel