Skip to content

Commit d6894d6

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 6342d49 commit d6894d6

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
@@ -2629,13 +2629,15 @@ bool
26292629
EvalPlanQualFetchRowMark(EPQState *epqstate, Index rti, TupleTableSlot *slot)
26302630
{
26312631
ExecAuxRowMark *earm = epqstate->relsubs_rowmark[rti - 1];
2632-
ExecRowMark *erm = earm->rowmark;
2632+
ExecRowMark *erm;
26332633
Datum datum;
26342634
bool isNull;
26352635

26362636
Assert(earm != NULL);
26372637
Assert(epqstate->origslot != NULL);
26382638

2639+
erm = earm->rowmark;
2640+
26392641
if (RowMarkRequiresRowShareLock(erm->markType))
26402642
elog(ERROR, "EvalPlanQual doesn't support locking rowmarks");
26412643

0 commit comments

Comments
 (0)