So I'm posting it here. The 3.8.6 Amalgam file generates an error in VS13 on 
Windows:
sqlite3.c(77874): error C4703: potentially uninitialized local pointer variable 
'pReadr' used


This is from the source file src/vbesort.c in a function called 
vdbeSorterSetupMerge:

      PmaReader *pReadr;
      SortSubtask *pLast = &pSorter->aTask[pSorter->nTask-1];
      rc = vdbeSortAllocUnpacked(pLast);
      if( rc==SQLITE_OK ){
        pReadr = (PmaReader*)sqlite3DbMallocZero(db, sizeof(PmaReader));
        pSorter->pReader = pReadr;
        if (pReadr == 0) rc = SQLITE_NOMEM;
      }
      if (rc == SQLITE_OK){
        rc = vdbeIncrMergerNew(pLast, pMain, &pReadr->pIncr); -- << Error line

Here is my fix:

      PmaReader *pReadr = 0;
      SortSubtask *pLast = &pSorter->aTask[pSorter->nTask-1];
      rc = vdbeSortAllocUnpacked(pLast);
      if( rc==SQLITE_OK ){
        pReadr = (PmaReader*)sqlite3DbMallocZero(db, sizeof(PmaReader));
        pSorter->pReader = pReadr;
      }
      if (pReadr == 0) rc = SQLITE_NOMEM;
      if (rc == SQLITE_OK){
        rc = vdbeIncrMergerNew(pLast, pMain, &pReadr->pIncr);
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to