/ Check-in [19f5c140]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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

Overview
Comment:Changes to avoid a harmless UB warning from clang.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 19f5c1400054df10688ab448e7e23afef97cab4a7c7a3e411f7527509b515dd8
User & Date: drh 2018-01-27 14:25:27
Context
2018-01-27
16:29
If a zipfile virtual table is created with no argument - "CREATE VIRTUAL TABLE zzz USING zipfile()" - accumulate data in memory. Support "SELECT zipfile_blob(z) FROM zzz LIMIT 1" to retrieve a zip archive image. check-in: e63185ed user: dan tags: trunk
14:25
Changes to avoid a harmless UB warning from clang. check-in: 19f5c140 user: drh tags: trunk
13:55
New test case for ticket [ec32177c99ccac2b1] that works without the STAT4. check-in: 5259d484 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/util.c.

   637    637     while( zNum<zEnd && zNum[0]=='0' ){ zNum+=incr; } /* Skip leading zeros. */
   638    638     for(i=0; &zNum[i]<zEnd && (c=zNum[i])>='0' && c<='9'; i+=incr){
   639    639       u = u*10 + c - '0';
   640    640     }
   641    641     testcase( i==18*incr );
   642    642     testcase( i==19*incr );
   643    643     testcase( i==20*incr );
   644         -  if( neg ){
          644  +  if( u>LARGEST_INT64 ){
          645  +    /* This test and assignment is needed only to suppress UB warnings
          646  +    ** from clang and -fsanitize=undefined.  This test and assignment make
          647  +    ** the code a little larger and slower, and no harm comes from omitting
          648  +    ** them, but we must appaise the undefined-behavior pharisees. */
          649  +    *pNum = neg ? SMALLEST_INT64 : LARGEST_INT64;
          650  +  }else if( neg ){
   645    651       *pNum = -(i64)u;
   646    652     }else{
   647    653       *pNum = (i64)u;
   648    654     }
   649    655     rc = 0;
   650    656     if( (i==0 && zStart==zNum)     /* No digits */
   651    657      || nonNum                     /* UTF16 with high-order bytes non-zero */