Skip to content

Commit 6e932d0

Browse files
danielgustafssonbigplaice
authored andcommitted
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 2f57965 commit 6e932d0

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/backend/executor/execMain.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2643,13 +2643,15 @@ bool
26432643
EvalPlanQualFetchRowMark(EPQState *epqstate, Index rti, TupleTableSlot *slot)
26442644
{
26452645
ExecAuxRowMark *earm = epqstate->relsubs_rowmark[rti - 1];
2646-
ExecRowMark *erm = earm->rowmark;
2646+
ExecRowMark *erm;
26472647
Datum datum;
26482648
bool isNull;
26492649

26502650
Assert(earm != NULL);
26512651
Assert(epqstate->origslot != NULL);
26522652

2653+
erm = earm->rowmark;
2654+
26532655
if (RowMarkRequiresRowShareLock(erm->markType))
26542656
elog(ERROR, "EvalPlanQual doesn't support locking rowmarks");
26552657

0 commit comments

Comments
 (0)