1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-12 13:01:09 +03:00

Make the sqlite3ExprCodeTarget() expression code generator routine robust

in the face of unknown opcodes - it simply generates a NULL value.

FossilOrigin-Name: f8e876c82a246ceed32b166f64e05dfe5ce4ab4c6820be60404109b43d36bb80
This commit is contained in:
drh
2019-12-14 15:01:55 +00:00
parent 5be1b20aec
commit aac30f9b50
3 changed files with 11 additions and 10 deletions

View File

@@ -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 */