Re: [PATCH] genrecog: Fix crash on invalid input

2016-03-14 Thread Bernd Schmidt
On 03/14/2016 09:00 PM, Segher Boessenkool wrote: There is just the single caller, and pred is set right before the call there. How about this patch, then? Looks alright. Bernd

Re: [PATCH] genrecog: Fix crash on invalid input

2016-03-14 Thread Segher Boessenkool
How about this patch, then? Segher Subject: [PATCH] genrecog: Fix crash on invalid input If your machine description refers to a non-existent predicate genrecog crashes. This fixes it. 2016-03-14 Segher Boeesenkool * genrecog.c (match_pattern_2): If pred is NULL don

Re: [PATCH] genrecog: Fix crash on invalid input

2016-03-14 Thread Segher Boessenkool
On Mon, Mar 14, 2016 at 06:39:12PM +0100, Bernd Schmidt wrote: > On 03/14/2016 04:38 PM, Segher Boessenkool wrote: > >If your machine description refers to a non-existent predicate genrecog > >crashes. This fixes it. > > Might be better to fix the caller? Yeah maybe. The next function that take

Re: [PATCH] genrecog: Fix crash on invalid input

2016-03-14 Thread Bernd Schmidt
On 03/14/2016 04:38 PM, Segher Boessenkool wrote: If your machine description refers to a non-existent predicate genrecog crashes. This fixes it. Might be better to fix the caller? Bernd

[PATCH] genrecog: Fix crash on invalid input

2016-03-14 Thread Segher Boessenkool
If your machine description refers to a non-existent predicate genrecog crashes. This fixes it. Is this okay for trunk? Segher 2016-03-14 Segher Boeesenkool * genrecog.c (safe_predicate_mode): If PRED is NULL, return false. --- gcc/genrecog.c | 3 +++ 1 file changed, 3 insertion