summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2020-03-02 16:17:32 +0100
committerThomas Haller <thaller@redhat.com>2020-03-02 16:20:50 +0100
commit4087024a9b1dcad5c819cde0d2902b94f6beeef4 (patch)
treeabea797f801c6996ed61d4575c74fbf20c0c8c92
parent8b63fd8cc0c1631ea7c1936f696a0078f4597acf (diff)
downloadNetworkManager-4087024a9b1dcad5c819cde0d2902b94f6beeef4.tar.gz
shared: move assertion in _NM_UTILS_STRING_TABLE_LOOKUP_DEFINE()
Move the assertion for valid LIST first. It only checks static data, and regardless of the entry_cmd, it should be done first. Fixes: f4d12f7b59b6 ('shared: add NM_UTILS_STRING_TABLE_LOOKUP_STRUCT_DEFINE() macro for lookup of structs')
-rw-r--r--shared/nm-glib-aux/nm-shared-utils.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/shared/nm-glib-aux/nm-shared-utils.h b/shared/nm-glib-aux/nm-shared-utils.h
index 63badb3cd6..115f9179d5 100644
--- a/shared/nm-glib-aux/nm-shared-utils.h
+++ b/shared/nm-glib-aux/nm-shared-utils.h
@@ -1564,8 +1564,6 @@ fcn_name (const char *name) \
__VA_ARGS__ \
}; \
\
- { entry_cmd; } \
- \
if (NM_MORE_ASSERT_ONCE (5)) { \
int i; \
\
@@ -1576,6 +1574,8 @@ fcn_name (const char *name) \
} \
} \
\
+ { entry_cmd; } \
+ \
if (G_LIKELY (name)) { \
G_STATIC_ASSERT (G_N_ELEMENTS (LIST) > 1); \
G_STATIC_ASSERT (G_N_ELEMENTS (LIST) < G_MAXUINT / 2u - 10u); \