aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2023-02-22 14:27:56 -0800
committerAndres Freund <andres@anarazel.de>2023-02-22 14:30:39 -0800
commit78be04e4c672a3ffb9c92dbb172dbd16edce8941 (patch)
tree07c54464bb9d1bce909f9709d464171416c0dcfe /src
parent5e044471a1aa8714d4fc59ea0d599009aaa05278 (diff)
downloadpostgresql-78be04e4c672a3ffb9c92dbb172dbd16edce8941.tar.gz
postgresql-78be04e4c672a3ffb9c92dbb172dbd16edce8941.zip
Add static assertion ensuring sizeof(ExprEvalStep) <= 64 bytes
This was previously only documented in a comment. Given the size of the struct, it's not hard to miss that comment. As evidenced by the commits leading up to fe3caa14393, 67b26703b41. It's possible, but not likely, that we might have to weaken these assertions on a less commonly used architecture. Author: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/295606.1677101684@sss.pgh.pa.us
Diffstat (limited to 'src')
-rw-r--r--src/include/executor/execExpr.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/include/executor/execExpr.h b/src/include/executor/execExpr.h
index 86e1ac1e65c..06c3adc0a19 100644
--- a/src/include/executor/execExpr.h
+++ b/src/include/executor/execExpr.h
@@ -669,6 +669,10 @@ typedef struct ExprEvalStep
} d;
} ExprEvalStep;
+/* Enforce the size rule given in the comment above */
+StaticAssertDecl(sizeof(ExprEvalStep) <= 64,
+ "size of ExprEvalStep exceeds 64 bytes");
+
/* Non-inline data for container operations */
typedef struct SubscriptingRefState