bug-patch
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-patch] [PATCH] remove side effect from assert


From: Andreas Gruenbacher
Subject: Re: [bug-patch] [PATCH] remove side effect from assert
Date: Wed, 25 May 2011 14:46:49 +0200
User-agent: KMail/1.12.4 (Linux/2.6.36-rc7+; KDE/4.3.5; i686; ; )

On Tuesday 24 May 2011 15:42:49 Jim Meyering wrote:
> While looking at the nearby expression (suspicious-but-ok,
> highlighted by coverity as matching the form malloc(strlen(...)),
> 
>   u = v = xmalloc (strlen (s));
> 
> I saw that the preceding assert statement had a side effect:
> 
>     assert (*s++ == '"');
> 
> That means disabling assertions would have impacted correctness.
> Here's the fix:

Good catch.

Thanks,
Andreas



reply via email to

[Prev in Thread] Current Thread [Next in Thread]