aboutsummaryrefslogtreecommitdiff
path: root/src/vdbeaux.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vdbeaux.c')
-rw-r--r--src/vdbeaux.c26
1 files changed, 19 insertions, 7 deletions
diff --git a/src/vdbeaux.c b/src/vdbeaux.c
index eafc03856..27be95a6b 100644
--- a/src/vdbeaux.c
+++ b/src/vdbeaux.c
@@ -1002,6 +1002,10 @@ void sqlite3VdbeNoJumpsOutsideSubrtn(
int iDest = pOp->p2; /* Jump destination */
if( iDest==0 ) continue;
if( pOp->opcode==OP_Gosub ) continue;
+ if( pOp->p3==20230325 && pOp->opcode==OP_NotNull ){
+ /* This is a deliberately taken illegal branch. tag-20230325-2 */
+ continue;
+ }
if( iDest<0 ){
int j = ADDR(iDest);
assert( j>=0 );
@@ -4461,6 +4465,16 @@ SQLITE_NOINLINE int sqlite3BlobCompare(const Mem *pB1, const Mem *pB2){
return n1 - n2;
}
+/* The following two functions are used only within testcase() to prove
+** test coverage. These functions do no exist for production builds.
+** We must use separate SQLITE_NOINLINE functions here, since otherwise
+** optimizer code movement causes gcov to become very confused.
+*/
+#if defined(SQLITE_COVERAGE_TEST) || defined(SQLITE_DEBUG)
+static int SQLITE_NOINLINE doubleLt(double a, double b){ return a<b; }
+static int SQLITE_NOINLINE doubleEq(double a, double b){ return a==b; }
+#endif
+
/*
** Do a comparison between a 64-bit signed integer and a 64-bit floating-point
** number. Return negative, zero, or positive if the first (i64) is less than,
@@ -4472,8 +4486,7 @@ int sqlite3IntFloatCompare(i64 i, double r){
testcase( x<r );
testcase( x>r );
testcase( x==r );
- if( x<r ) return -1;
- return x>r; /*NO_TEST*/ /* work around bug in gcov */
+ return (x<r) ? -1 : (x>r);
}else{
i64 y;
double s;
@@ -4482,12 +4495,11 @@ int sqlite3IntFloatCompare(i64 i, double r){
y = (i64)r;
if( i<y ) return -1;
if( i>y ) return +1;
- testcase( r<(double)i );
- testcase( r>(double)i );
- testcase( r==(double)i );
s = (double)i;
- if( s<r ) return -1;
- return s>r; /*NO_TEST*/ /* work around bug in gcov */
+ testcase( doubleLt(s,r) );
+ testcase( doubleLt(r,s) );
+ testcase( doubleEq(r,s) );
+ return (s<r) ? -1 : (s>r);
}
}