/ Check-in [98b3b975]
Login

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

Overview
Comment:Reinitialize debugging information on registers of a trigger prior to each invocation of the trigger. This prevents false-positives from the sqlite3VdbeMemAboutToChange() test logic.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:98b3b97573ccb3d986d1552f97f96e15088a598945923adcac77010c1e8b7fe4
User & Date: drh 2019-01-25 19:29:01
Context
2019-01-25
20:09
Do not accidently truncate zeroblob values when doing an arithmetic operation. Fix for ticket [bb4bdb9f7f654b0bb9f34cfba]. check-in: 13f6942e user: drh tags: trunk
19:29
Reinitialize debugging information on registers of a trigger prior to each invocation of the trigger. This prevents false-positives from the sqlite3VdbeMemAboutToChange() test logic. check-in: 98b3b975 user: drh tags: trunk
18:17
Fix harmless compiler warnings. check-in: 3ff220ad user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/vdbe.c.

  6167   6167     p->apCsr = (VdbeCursor **)&aMem[p->nMem];
  6168   6168     pFrame->aOnce = (u8*)&p->apCsr[pProgram->nCsr];
  6169   6169     memset(pFrame->aOnce, 0, (pProgram->nOp + 7)/8);
  6170   6170     p->aOp = aOp = pProgram->aOp;
  6171   6171     p->nOp = pProgram->nOp;
  6172   6172   #ifdef SQLITE_ENABLE_STMT_SCANSTATUS
  6173   6173     p->anExec = 0;
         6174  +#endif
         6175  +#ifdef SQLITE_DEBUG
         6176  +  /* Verify that second and subsequent executions of the same trigger do not
         6177  +  ** try to reuse register values from the first use. */
         6178  +  {
         6179  +    int i;
         6180  +    for(i=0; i<p->nMem; i++){
         6181  +      aMem[i].pScopyFrom = 0;  /* Prevent false-positive AboutToChange() errs */
         6182  +      aMem[i].flags |= MEM_Undefined; /* Cause a fault if this reg is reused */
         6183  +    }
         6184  +  }
  6174   6185   #endif
  6175   6186     pOp = &aOp[-1];
  6176   6187   
  6177   6188     break;
  6178   6189   }
  6179   6190   
  6180   6191   /* Opcode: Param P1 P2 * * *