summaryrefslogtreecommitdiff
path: root/src/backend
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend')
-rw-r--r--src/backend/storage/aio/aio.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/backend/storage/aio/aio.c b/src/backend/storage/aio/aio.c
index 87d7136a936..dcc47069757 100644
--- a/src/backend/storage/aio/aio.c
+++ b/src/backend/storage/aio/aio.c
@@ -89,6 +89,9 @@ static const IoMethodOps *const pgaio_method_ops_table[] = {
#endif
};
+StaticAssertDecl(lengthof(io_method_options) == lengthof(pgaio_method_ops_table) + 1,
+ "io_method_options out of sync with pgaio_method_ops_table");
+
/* callbacks for the configured io_method, set by assign_io_method */
const IoMethodOps *pgaio_method_ops;
@@ -1318,8 +1321,8 @@ pgaio_shutdown(int code, Datum arg)
void
assign_io_method(int newval, void *extra)
{
+ Assert(newval < lengthof(pgaio_method_ops_table));
Assert(pgaio_method_ops_table[newval] != NULL);
- Assert(newval < lengthof(io_method_options));
pgaio_method_ops = pgaio_method_ops_table[newval];
}