Skip to content

Commit 9fcd360

Browse files
Fix assertion on dereferenced object
Commit 27cc7cd accidentally placed the assertion ensuring that the pointer isn't NULL after it had already been accessed. Fix by moving the pointer dereferencing to after the assertion. Backpatch to all supported branches. Author: Dmitry Koval <d.koval@postgrespro.ru> Reviewed-by: Daniel Gustafsson <daniel@yesql.se> Reviewed-by: Michael Paquier <michael@paquier.xyz> Discussion: https://postgr.es/m/1618848d-cdc7-414b-9c03-08cf4bef4408@postgrespro.ru Backpatch-through: 13
1 parent 5209058 commit 9fcd360

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/backend/executor/execMain.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -2555,13 +2555,15 @@ bool
25552555
EvalPlanQualFetchRowMark(EPQState *epqstate, Index rti, TupleTableSlot *slot)
25562556
{
25572557
ExecAuxRowMark *earm = epqstate->relsubs_rowmark[rti - 1];
2558-
ExecRowMark *erm = earm->rowmark;
2558+
ExecRowMark *erm;
25592559
Datum datum;
25602560
bool isNull;
25612561

25622562
Assert(earm != NULL);
25632563
Assert(epqstate->origslot != NULL);
25642564

2565+
erm = earm->rowmark;
2566+
25652567
if (RowMarkRequiresRowShareLock(erm->markType))
25662568
elog(ERROR, "EvalPlanQual doesn't support locking rowmarks");
25672569

0 commit comments

Comments
 (0)