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

Improved comments. Add assert()s to verify that the AggInfo structure

is unchanged after registers have been assigned.

FossilOrigin-Name: 5200b84195ee1ccaa387f7032eae3d463724c48cb53ba0251bbc79e927dd9752
This commit is contained in:
drh
2022-11-25 13:08:20 +00:00
parent 8683c09281
commit 7960da0346
5 changed files with 35 additions and 12 deletions

View File

@@ -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.