diff options
author | drh <> | 2022-11-25 13:08:20 +0000 |
---|---|---|
committer | drh <> | 2022-11-25 13:08:20 +0000 |
commit | 7960da03466d96209f53defe088fc16916ba26fc (patch) | |
tree | afc355b8eb3bb1586d7adacc79a2902454f92370 /src/sqliteInt.h | |
parent | 8683c0928111707903654278e6c87634cbee5d8c (diff) | |
download | sqlite-7960da03466d96209f53defe088fc16916ba26fc.tar.gz sqlite-7960da03466d96209f53defe088fc16916ba26fc.zip |
Improved comments. Add assert()s to verify that the AggInfo structure
is unchanged after registers have been assigned.
FossilOrigin-Name: 5200b84195ee1ccaa387f7032eae3d463724c48cb53ba0251bbc79e927dd9752
Diffstat (limited to 'src/sqliteInt.h')
-rw-r--r-- | src/sqliteInt.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/sqliteInt.h b/src/sqliteInt.h index 3ecdb35fe..db65082bb 100644 --- a/src/sqliteInt.h +++ b/src/sqliteInt.h @@ -2766,10 +2766,15 @@ struct AggInfo { }; /* -** Macros to compute aCol[] and aFunc[] register numbers: +** Macros to compute aCol[] and aFunc[] register numbers. +** +** These macros should not be used prior to the call to +** assignAggregateRegisters() that computes the value of pAggInfo->iFirstReg. +** The assert()s that are part of this macro verify that constraint. */ -#define AggInfoColumnReg(A,I) ((A)->iFirstReg+(I)) -#define AggInfoFuncReg(A,I) ((A)->iFirstReg+(A)->nColumn+(I)) +#define AggInfoColumnReg(A,I) (assert((A)->iFirstReg),(A)->iFirstReg+(I)) +#define AggInfoFuncReg(A,I) \ + (assert((A)->iFirstReg),(A)->iFirstReg+(A)->nColumn+(I)) /* ** The datatype ynVar is a signed integer, either 16-bit or 32-bit. |