You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Daniel Rall <dl...@collab.net> on 2007/09/06 17:11:42 UTC

Formalizing flow control 'goto' macros

On Wed, 29 Aug 2007, Daniel Rall wrote:

> 
> On Aug 29, 2007, at 1:36 AM, Daniel Rall wrote:
> 
> >
> >On Aug 28, 2007, at 4:39 AM, Lieven Govaerts wrote:
> >
> >>Quoting Daniel Rall <dl...@finemaltcoding.com>:
> >>
> >>>
> >>>On Aug 26, 2007, at 1:05 AM, Lieven Govaerts wrote:
> >>..
> >>>>In mergeinfo-sqlite-index.c/svn_fs_mergeinfo__get_mergeinfo(), but
> >>>>also
> >>>>in svn_fs_mergeinfo__update_index and
> >>>>svn_fs_mergeinfo__get_mergeinfo_for_tree the call to  
> >>>>sqlite3_close is
> >>>>not in the 'finally' path (in java terms), so whenever there's an
> >>>>error
> >>>>accessing the database it's not closed correctly.
> >>>>
> >>>>Does this make sense?
> >>>
> >>>Thanks for the report, Lieven.  I've added some simple error  
> >>>handling
> >>>improvements in r26340 which fix this problem.
> >>
> >>That should do it. One small remark: What do you think of renaming  
> >>the
> >>MAYBE_CLEANUP macro to CLEANUP_ON_ERROR, extending it
> >>to take the 'err' variable as parameter and move to a
> >>common include file so we can use it throughout whole the code?  
> >>I've found
> >>hundreds of instances where we use this pattern, might as well  
> >>make it more
> >>standard.
> >
> >That's not a bad idea -- I cribbed the pattern from libsvn_wc.  I  
> >guess this would live in a header file under include/private/?
> 
> Were you thinking of something like the attached patch, or perhaps  
> with a set of macros corresponding to each common label name (e.g.  
> error, cleanup, done)?

I committed this patch as-is in r26483.