/ Check-in [8a606e4a]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Interchange to branches within an "if" statement in sqlite3_value_pointer() in order to work around a bug in gcc.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | branch-3.20
Files: files | file ages | folders
SHA3-256:8a606e4abab4efa03f2e5ffc33d7c5faa3c663f339da87b4ce9f3feed5dc7194
User & Date: drh 2017-07-17 17:46:29
Context
2017-07-17
18:45
Merge all changes from branch-3.20. Improvements to the fts5() extension interface. Work around a gcc/valgrind bug in the sqlite3_value_pointer() interface. check-in: e0aca7d2 user: drh tags: trunk
17:46
Interchange to branches within an "if" statement in sqlite3_value_pointer() in order to work around a bug in gcc. Closed-Leaf check-in: 8a606e4a user: drh tags: branch-3.20
15:38
Improved the interface to the fts5() extension mechanism for enhanced security. check-in: bc78235f user: drh tags: branch-3.20
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/vdbeapi.c.

198
199
200
201
202
203
204
205
206

207
208
209
210
211
212
213
unsigned int sqlite3_value_subtype(sqlite3_value *pVal){
  Mem *pMem = (Mem*)pVal;
  return ((pMem->flags & MEM_Subtype) ? pMem->eSubtype : 0);
}
void *sqlite3_value_pointer(sqlite3_value *pVal, const char *zPType){
  Mem *p = (Mem*)pVal;
  if( p->flags==(MEM_Null|MEM_Subtype|MEM_Term|MEM_Static)
   && p->eSubtype=='p'
   && zPType!=0

   && strcmp(p->z, zPType)==0
  ){
    return p->u.pPtr;
  }else{
    return 0;
  }
}







<

>







198
199
200
201
202
203
204

205
206
207
208
209
210
211
212
213
unsigned int sqlite3_value_subtype(sqlite3_value *pVal){
  Mem *pMem = (Mem*)pVal;
  return ((pMem->flags & MEM_Subtype) ? pMem->eSubtype : 0);
}
void *sqlite3_value_pointer(sqlite3_value *pVal, const char *zPType){
  Mem *p = (Mem*)pVal;
  if( p->flags==(MEM_Null|MEM_Subtype|MEM_Term|MEM_Static)

   && zPType!=0
   && p->eSubtype=='p'
   && strcmp(p->z, zPType)==0
  ){
    return p->u.pPtr;
  }else{
    return 0;
  }
}