Subject: Re: bug#41754: [feature/native-comp] Fix crash when loading lambdas from dumps with --enable-checking.

From: Eli Zaretskii <[email-masked]>
Date: Tue, 09 Jun 2020 18:02:49 +0300

> From: Nicolas Bértolo <[email-masked]>
> Date: Tue, 9 Jun 2020 08:54:45 -0300
> Cc: [email-masked]
> 
> - Copy the suffixes before building the heap-based list in openp. I know this is
>   not the solution I proposed in the bug report, but I couldn't adapt the code
>   without increasing its complexity way too much for my liking. If you think
>   this is not an appropriate solution I will come up with another one.

This conses a string for each extension each time through the loop,
doesn't it?  Is that really necessary?

Maybe we should take a step back and consider restructuring the code a
bit.  AFAIU, you cons the extended_suf list to be able to use the
FOR_* loops that manipulate lists, is that correct?  If so, could it
be that removing that constraint will lead to a more elegant and less
expensive code?  After all, all this function does is to append STR to
each directory in PATH, then try finding the resulting file with or
without one of the extensions in SUFFIXES.  Could we produce the file
name to probe without walking a single list?