/ Check-in [22a7c15b]
Login

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

Overview
Comment:Add assert()s in os_win.c in an effort to silence false-positives from static analyzers.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 22a7c15b262376fb0ce4dd3d044373380d86c5ccd96e2f24576cf04318597c33
User & Date: drh 2019-07-16 18:27:07
Context
2019-07-16
19:44
Add new assert() statements in an attempt to help static analyzers avoid false-positives. check-in: 9e664585 user: drh tags: trunk
18:27
Add assert()s in os_win.c in an effort to silence false-positives from static analyzers. check-in: 22a7c15b user: drh tags: trunk
05:11
Call ioctl() with the correct signature on both Android and stock Linux. check-in: 24225349 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/os_win.c.

  4211   4211     DWORD flags = FILE_MAP_WRITE | FILE_MAP_READ;
  4212   4212     int rc = SQLITE_OK;
  4213   4213   
  4214   4214     if( !pShm ){
  4215   4215       rc = winOpenSharedMemory(pDbFd);
  4216   4216       if( rc!=SQLITE_OK ) return rc;
  4217   4217       pShm = pDbFd->pShm;
         4218  +    assert( pShm!=0 );
  4218   4219     }
  4219   4220     pShmNode = pShm->pShmNode;
  4220   4221   
  4221   4222     sqlite3_mutex_enter(pShmNode->mutex);
  4222   4223     if( pShmNode->isUnlocked ){
  4223   4224       rc = winLockSharedMemory(pShmNode);
  4224   4225       if( rc!=SQLITE_OK ) goto shmpage_out;
................................................................................
  4513   4514         if( rc!=SQLITE_OK ){
  4514   4515           OSTRACE(("FETCH pid=%lu, pFile=%p, rc=%s\n",
  4515   4516                    osGetCurrentProcessId(), pFd, sqlite3ErrName(rc)));
  4516   4517           return rc;
  4517   4518         }
  4518   4519       }
  4519   4520       if( pFd->mmapSize >= iOff+nAmt ){
         4521  +      assert( pFd->pMapRegion!=0 );
  4520   4522         *pp = &((u8 *)pFd->pMapRegion)[iOff];
  4521   4523         pFd->nFetchOut++;
  4522   4524       }
  4523   4525     }
  4524   4526   #endif
  4525   4527   
  4526   4528     OSTRACE(("FETCH pid=%lu, pFile=%p, pp=%p, *pp=%p, rc=SQLITE_OK\n",