summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Gustafsson2025-02-14 10:50:56 +0000
committerDaniel Gustafsson2025-02-14 10:50:56 +0000
commit67a02341572e0dcf27a290953317a39c7f15cc82 (patch)
tree449b2f5bee8760e60527b11afcf7a8eca8e0aa7b
parent9e17ac997f921c9de99125a97a0f34ae50f5c498 (diff)
Fix assertion on dereferenced object
Commit 27cc7cd2bc8a 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 <[email protected]> Reviewed-by: Daniel Gustafsson <[email protected]> Reviewed-by: Michael Paquier <[email protected]> Discussion: https://postgr.es/m/[email protected] Backpatch-through: 13
-rw-r--r--src/backend/executor/execMain.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/backend/executor/execMain.c b/src/backend/executor/execMain.c
index 39d80ccfbad..963aa390620 100644
--- a/src/backend/executor/execMain.c
+++ b/src/backend/executor/execMain.c
@@ -2662,13 +2662,15 @@ bool
EvalPlanQualFetchRowMark(EPQState *epqstate, Index rti, TupleTableSlot *slot)
{
ExecAuxRowMark *earm = epqstate->relsubs_rowmark[rti - 1];
- ExecRowMark *erm = earm->rowmark;
+ ExecRowMark *erm;
Datum datum;
bool isNull;
Assert(earm != NULL);
Assert(epqstate->origslot != NULL);
+ erm = earm->rowmark;
+
if (RowMarkRequiresRowShareLock(erm->markType))
elog(ERROR, "EvalPlanQual doesn't support locking rowmarks");