You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by bl...@apache.org on 2010/12/27 23:19:52 UTC
svn commit: r1053208 - /subversion/trunk/subversion/libsvn_subr/error.c
Author: blair
Date: Mon Dec 27 22:19:52 2010
New Revision: 1053208
URL: http://svn.apache.org/viewvc?rev=1053208&view=rev
Log:
Fix a bug in svn_error_raise_on_malfunction() where it needs to call
svn_error__locate() because it is not using the svn_error_createf()
macro but the function directly.
I checked all the other uses of the undefined macros and
svn_error__locate() is properly called before make_error_internal() is
called.
* subversion/libsvn_subr/error.c
(svn_error_raise_on_malfunction):
Because the svn_error_createf() macro that otherwise would call
svn_error__locate() is undefined at the function definition, the
filename and line number where the error is being thrown from will
not be set, so add an explicit call to svn_error__locate().
Modified:
subversion/trunk/subversion/libsvn_subr/error.c
Modified: subversion/trunk/subversion/libsvn_subr/error.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/error.c?rev=1053208&r1=1053207&r2=1053208&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/error.c (original)
+++ subversion/trunk/subversion/libsvn_subr/error.c Mon Dec 27 22:19:52 2010
@@ -42,7 +42,15 @@ static const char SVN_FILE_LINE_UNDEFINE
#include "private/svn_error_private.h"
-/*** Helpers for creating errors ***/
+/*
+ * Undefine the helpers for creating errors.
+ *
+ * *NOTE*: Any use of these functions in any other function may need
+ * to call svn_error__locate() because the macro that would otherwise
+ * do this is being undefined and the filename and line number will
+ * not be properly set in the static error_file and error_line
+ * variables.
+ */
#undef svn_error_create
#undef svn_error_createf
#undef svn_error_quick_wrap
@@ -594,6 +602,11 @@ svn_error_raise_on_malfunction(svn_boole
if (!can_return)
abort(); /* Nothing else we can do as a library */
+ /* The filename and line number of the error source needs to be set
+ here because svn_error_createf() is not the macro defined in
+ svn_error.h but the real function. */
+ svn_error__locate(file, line);
+
if (expr)
return svn_error_createf(SVN_ERR_ASSERTION_FAIL, NULL,
_("In file '%s' line %d: assertion failed (%s)"),