On Sat, Feb 22, 2014 at 4:38 PM, Joshua Cranmer 🐧 <pidgeo...@gmail.com> wrote:
> On 2/22/2014 5:22 PM, Justin Dolske wrote:
>>
>> But really, the best way to fix this would be to use a macro:
>>
>>   err = SSLHashSHA1.update(&hashCtx, &foo);
>>   SSL_ENSURE_SUCCESS(err, err);
>>   err = SSLHashSHA1.update(&hashCtx, &bar);
>>   SSL_ENSURE_SUCCESS(err, err);
>>   err = SSLHashSHA1.update(&hashCtx, &baz);
>>   SSL_ENSURE_SUCCESS(err, err);
>>
>> Ok, maybe I'm not being entirely serious. :P
>
>
> Being serious here, early-return and RTTI (to handle the cleanup prior to
> exit) would have eliminated the need for gotos in the first place.
>
>
> --
> Joshua Cranmer
> Thunderbird and DXR developer
> Source code archæologist
>
> _______________________________________________
> dev-platform mailing list
> dev-platform@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-platform

Replacing goto with return is not sufficient.  You're still vulnerable
to the same mistake.

- Kyle
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to