aboutsummaryrefslogtreecommitdiff
path: root/src/vdbe.c
diff options
context:
space:
mode:
authordrh <>2021-03-28 23:37:56 +0000
committerdrh <>2021-03-28 23:37:56 +0000
commit1af3fd562fc26c0aaf2bc5c6b3b6097ae17d4abb (patch)
tree8f429c4e4ebec6b8ed5aa44fe0a84f8cd20838c6 /src/vdbe.c
parent9cffb0ffb9b393e1231496d88a3d488e0f877183 (diff)
downloadsqlite-1af3fd562fc26c0aaf2bc5c6b3b6097ae17d4abb.tar.gz
sqlite-1af3fd562fc26c0aaf2bc5c6b3b6097ae17d4abb.zip
Alternative implementation of the comparison opcode speed-up of
check-in [4a8805d9a66dc888] that should pass muster with UBSAN. FossilOrigin-Name: afb18f64541effaeaada2d72c7c91adfe5ec3e2b1418c0bc281083125fb5badb
Diffstat (limited to 'src/vdbe.c')
-rw-r--r--src/vdbe.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/vdbe.c b/src/vdbe.c
index 080c7eaf8..0026ed377 100644
--- a/src/vdbe.c
+++ b/src/vdbe.c
@@ -2111,15 +2111,12 @@ compare_op:
** order: NE, EQ, GT, LE, LT, GE */
assert( OP_Eq==OP_Ne+1 ); assert( OP_Gt==OP_Ne+2 ); assert( OP_Le==OP_Ne+3 );
assert( OP_Lt==OP_Ne+4 ); assert( OP_Ge==OP_Ne+5 );
- if( res<0 ){ /* ne, eq, gt, le, lt, ge */
- static const unsigned char aLTb[] = { 1, 0, 0, 1, 1, 0 };
- res2 = aLTb[pOp->opcode - OP_Ne];
+ if( res<0 ){
+ res2 = sqlite3aLTb[pOp->opcode];
}else if( res==0 ){
- static const unsigned char aEQb[] = { 0, 1, 0, 1, 0, 1 };
- res2 = aEQb[pOp->opcode - OP_Ne];
+ res2 = sqlite3aEQb[pOp->opcode];
}else{
- static const unsigned char aGTb[] = { 1, 0, 1, 0, 0, 1 };
- res2 = aGTb[pOp->opcode - OP_Ne];
+ res2 = sqlite3aGTb[pOp->opcode];
}
/* Undo any changes made by applyAffinity() to the input registers. */