1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

Improved implementation of the destructor on pointer-passing interfaces.

FossilOrigin-Name: 601ad6795927fff8c3cc1711a2fd90912499573e94aa5bc8f18cbd4b89778f58
This commit is contained in:
drh
2017-07-27 15:53:24 +00:00
parent 22930062d5
commit a0024e6c99
7 changed files with 60 additions and 41 deletions

View File

@@ -201,8 +201,10 @@ unsigned int sqlite3_value_subtype(sqlite3_value *pVal){
}
void *sqlite3_value_pointer(sqlite3_value *pVal, const char *zPType){
Mem *p = (Mem*)pVal;
if( (p->flags&(MEM_AffMask|MEM_Pointer))==(MEM_Null|MEM_Pointer)
if( (p->flags&(MEM_TypeMask|MEM_Term|MEM_Subtype)) ==
(MEM_Null|MEM_Term|MEM_Subtype)
&& zPType!=0
&& p->eSubtype=='p'
&& strcmp(p->u.zPType, zPType)==0
){
return (void*)p->z;