/ Check-in [459a0b45]
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:Remove an unnecessary branch from the OP_String8 opcode.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 459a0b456da69112605b37adc9af27d79e35a4d7
User & Date: drh 2016-04-30 18:10:34
Context
2016-04-30
19:23
Change the way tester.tcl handes $argv so that in "permutations.test <permutation> <filename>" <filename> may be the name of any file in the test/ directory. check-in: 820c57bb user: dan tags: trunk
18:10
Remove an unnecessary branch from the OP_String8 opcode. check-in: 459a0b45 user: drh tags: trunk
17:19
More bug fixes to Lemon identified by Kelvin Sherlock. None of these have any impact on SQLite. check-in: 762bdc55 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/vdbe.c.

  1060   1060     pOut = out2Prerelease(p, pOp);
  1061   1061     pOp->opcode = OP_String;
  1062   1062     pOp->p1 = sqlite3Strlen30(pOp->p4.z);
  1063   1063   
  1064   1064   #ifndef SQLITE_OMIT_UTF16
  1065   1065     if( encoding!=SQLITE_UTF8 ){
  1066   1066       rc = sqlite3VdbeMemSetStr(pOut, pOp->p4.z, -1, SQLITE_UTF8, SQLITE_STATIC);
  1067         -    if( rc ){
  1068         -      assert( rc==SQLITE_TOOBIG ); /* This is the only possible error here */
  1069         -      goto too_big;
  1070         -    }
         1067  +    assert( rc==SQLITE_OK || rc==SQLITE_TOOBIG );
  1071   1068       if( SQLITE_OK!=sqlite3VdbeChangeEncoding(pOut, encoding) ) goto no_mem;
  1072   1069       assert( pOut->szMalloc>0 && pOut->zMalloc==pOut->z );
  1073   1070       assert( VdbeMemDynamic(pOut)==0 );
  1074   1071       pOut->szMalloc = 0;
  1075   1072       pOut->flags |= MEM_Static;
  1076   1073       if( pOp->p4type==P4_DYNAMIC ){
  1077   1074         sqlite3DbFree(db, pOp->p4.z);
  1078   1075       }
  1079   1076       pOp->p4type = P4_DYNAMIC;
  1080   1077       pOp->p4.z = pOut->z;
  1081   1078       pOp->p1 = pOut->n;
  1082   1079     }
         1080  +  testcase( rc==SQLITE_TOOBIG );
  1083   1081   #endif
  1084   1082     if( pOp->p1>db->aLimit[SQLITE_LIMIT_LENGTH] ){
  1085   1083       goto too_big;
  1086   1084     }
         1085  +  assert( rc==SQLITE_OK );
  1087   1086     /* Fall through to the next case, OP_String */
  1088   1087   }
  1089   1088     
  1090   1089   /* Opcode: String P1 P2 P3 P4 P5
  1091   1090   ** Synopsis: r[P2]='P4' (len=P1)
  1092   1091   **
  1093   1092   ** The string value P4 of length P1 (bytes) is stored in register P2.