Hello, Sean.

2012/8/2 Sean Bartell <[email protected]>:
>> Now, concretely: in parse_if, you jump into a conditional block. I
>> would consider that a very bad practice and actually I am surprised
>> that such jump does not produce any warning. Better is to go with the
>> common practice and put the error block at the end of the function.
>
> Well, the whole purpose of goto is to interfere with the control flow.
> It could be confusing, though, so I fixed it by moving some code to a
> separate function.
Thanks. I agree, my point was about not creating surprises.


> I have a general principle that functions like bithenge_if_transform()
> and bithenge_const_expression() should reliably free their arguments,
> even if an error occurs. I've added an explanation to the wiki page[0].
Aha. I should have read the code more carefully.

Btw, I started writing script for BMP images. It needs repetitions to
be applicable to arbitrary file but with hard-coded values I am able
to completely decode simple images.

Bye
- Vojta

>
> bithenge_if_transform() follows this principle and does not leak, even
> on error (I checked with Valgrind). However, I forgot to free the node
> in bithenge_const_expression() when an error occurs, so it was a leak.
> Thanks for pointing this out.
>
> Thanks,
> Sean
>
> [0] http://trac.helenos.org/wiki/StructuredBinaryData#UsingtheAPI
>
> _______________________________________________
> HelenOS-devel mailing list
> [email protected]
> http://lists.modry.cz/cgi-bin/listinfo/helenos-devel

_______________________________________________
HelenOS-devel mailing list
[email protected]
http://lists.modry.cz/cgi-bin/listinfo/helenos-devel

Reply via email to