Greg Stein wrote:
> On Wed, Jan 21, 2009 at 19:52, Hyrum K. Wright <hyrum_at_hyrumwright.org> wrote:
>> ...
>> +++ trunk/subversion/libsvn_subr/sqlite.c Wed Jan 21 10:52:27 2009 (r35379)
>> @@ -50,6 +50,10 @@ sqlite_tracer(void *data, const char *sq
>> struct svn_sqlite__db_t
>> {
>> sqlite3 *db3;
>> + const char **statement_strings;
>
> You changed this decl in a later revision to:
>
> const char * const *statement_strings;
>
> but the argument uses [] ... maybe do the same here?
I tried, but the compiler wasn't too happy. We need to assign this variable,
and I don't think that an array name can be used as an lvalue.
>> ...
>> svn_error_t *
>> +svn_sqlite__get_statement(svn_sqlite__stmt_t **stmt, svn_sqlite__db_t *db,
>> + int stmt_idx)
>> +{
>> + if (db->prepared_stmts[stmt_idx] == NULL)
>> + SVN_ERR(svn_sqlite__prepare(&db->prepared_stmts[stmt_idx], db,
>> + db->statement_strings[stmt_idx], db->pool));
>
> Before the if, maybe add:
>
> SVN_ERR_ASSERT(stmt_idx < db->nbr_statements);
Ah, good idea. r35382.
-Hyrum
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1041968
Received on 2009-01-21 21:38:10 CET