Skip to content

Commit 6c1d4ad

Browse files
committed
Patch sqlite3.c to avoid CGo compiler warning
https://sqlite.org/forum/forumpost/e39020f82d
1 parent 748761b commit 6c1d4ad

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

c/sqlite3.c

+4-5
Original file line numberDiff line numberDiff line change
@@ -128974,9 +128974,9 @@ SQLITE_PRIVATE Select *sqlite3SelectNew(
128974128974
u32 selFlags, /* Flag parameters, such as SF_Distinct */
128975128975
Expr *pLimit /* LIMIT value. NULL means not used */
128976128976
){
128977-
Select *pNew;
128977+
Select *pNew, *pAllocated;
128978128978
Select standin;
128979-
pNew = sqlite3DbMallocRawNN(pParse->db, sizeof(*pNew) );
128979+
pAllocated = pNew = sqlite3DbMallocRawNN(pParse->db, sizeof(*pNew) );
128980128980
if( pNew==0 ){
128981128981
assert( pParse->db->mallocFailed );
128982128982
pNew = &standin;
@@ -129010,12 +129010,11 @@ SQLITE_PRIVATE Select *sqlite3SelectNew(
129010129010
#endif
129011129011
if( pParse->db->mallocFailed ) {
129012129012
clearSelect(pParse->db, pNew, pNew!=&standin);
129013-
pNew = 0;
129013+
pAllocated = 0;
129014129014
}else{
129015129015
assert( pNew->pSrc!=0 || pParse->nErr>0 );
129016129016
}
129017-
assert( pNew!=&standin );
129018-
return pNew;
129017+
return pAllocated;
129019129018
}
129020129019

129021129020

0 commit comments

Comments
 (0)