diff options
author | drh <> | 2021-10-07 17:43:30 +0000 |
---|---|---|
committer | drh <> | 2021-10-07 17:43:30 +0000 |
commit | a4eeccdfdf9a9b4a5a007d17ac51f124656272d9 (patch) | |
tree | 88ceffcbf0266114987be591131990addc08ca46 /src/sqliteInt.h | |
parent | 9d43db5b5c82a4242b97cd85c8950c3fcd1d6961 (diff) | |
download | sqlite-a4eeccdfdf9a9b4a5a007d17ac51f124656272d9.tar.gz sqlite-a4eeccdfdf9a9b4a5a007d17ac51f124656272d9.zip |
Protect all accesses to the Expr.x union using nearby assert()s and branches.
FossilOrigin-Name: 8eaa1d4a98b24adf245bbd2fe9212aa6a924a0f09c445906d7f87574f36a7423
Diffstat (limited to 'src/sqliteInt.h')
-rw-r--r-- | src/sqliteInt.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/sqliteInt.h b/src/sqliteInt.h index b486d904d..aae8f17b5 100644 --- a/src/sqliteInt.h +++ b/src/sqliteInt.h @@ -2886,6 +2886,16 @@ struct Expr { #define ExprAlwaysTrue(E) (((E)->flags&(EP_FromJoin|EP_IsTrue))==EP_IsTrue) #define ExprAlwaysFalse(E) (((E)->flags&(EP_FromJoin|EP_IsFalse))==EP_IsFalse) +/* +** Macros used to ensure that the correct members of unions are accessed. +*/ +#define ExprUseUToken(E) (((E)->flags&EP_IntValue)==0) +#define ExprUseUValue(E) (((E)->flags&EP_IntValue)!=0) +#define ExprUseXList(E) (((E)->flags&EP_xIsSelect)==0) +#define ExprUseXSelect(E) (((E)->flags&EP_xIsSelect)!=0) +#define ExprUseYTab(E) ((E)->op==TK_COLUMN) +#define ExprUseYWin(E) ((E)->flags&EP_WinFunc)!=0) +#define ExprUseYSub(E) ((E)->op==TK_IN||(E)->op==TK_SELECT||(E)->op==TK_EXISTS) /* Flags for use with Expr.vvaFlags */ |