diff options
author | drh <drh@noemail.net> | 2019-12-14 15:01:55 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2019-12-14 15:01:55 +0000 |
commit | aac30f9b5020f5af1bce935f3d90e9dab3722ba2 (patch) | |
tree | ffd128b0f375b6b1748bd0d12924b307bc18eaf0 /src | |
parent | 5be1b20aec9151af799d1294fc8328c8aaa17bd8 (diff) | |
download | sqlite-aac30f9b5020f5af1bce935f3d90e9dab3722ba2.tar.gz sqlite-aac30f9b5020f5af1bce935f3d90e9dab3722ba2.zip |
Make the sqlite3ExprCodeTarget() expression code generator routine robust
in the face of unknown opcodes - it simply generates a NULL value.
FossilOrigin-Name: f8e876c82a246ceed32b166f64e05dfe5ce4ab4c6820be60404109b43d36bb80
Diffstat (limited to 'src')
-rw-r--r-- | src/expr.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/expr.c b/src/expr.c index 3b2b513b6..c6920b3c8 100644 --- a/src/expr.c +++ b/src/expr.c @@ -3699,7 +3699,8 @@ expr_code_doover: sqlite3VdbeLoadString(v, target, pExpr->u.zToken); return target; } - case TK_NULL: { + default: { + testcase( op!=TK_NULL ); sqlite3VdbeAddOp2(v, OP_Null, 0, target); return target; } @@ -4210,7 +4211,7 @@ expr_code_doover: ** or if there is no matching Ei, the ELSE term Y, or if there is ** no ELSE term, NULL. */ - default: assert( op==TK_CASE ); { + case TK_CASE: { int endLabel; /* GOTO label for end of CASE stmt */ int nextCase; /* GOTO label for next WHEN clause */ int nExpr; /* 2x number of WHEN terms */ |