From 8c2a76f5846821b4d2ad5e5a0b9f39e01f381c82 Mon Sep 17 00:00:00 2001 From: Mikhail Koviazin Date: Fri, 7 Jun 2024 10:24:41 +0300 Subject: [PATCH] module: fix typo in `REGISTER_API` (#608) `REGISTER_API` is supposed to register two functions: one starts with `ValkeyModule_` and the other one with `RedisModule_`. It does so in `unstable` branch. However there was a copy-paste mistake during backporting it to 7.2. This caused modules built with `valkeymodule-rs` to fail since they called `RedisModule_SetModuleAttribs` which caused valkey to segfault. This commit fixes the typo. Signed-off-by: Mikhail Koviazin --- src/module.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/module.c b/src/module.c index e86183c58..1e1d0d2ae 100644 --- a/src/module.c +++ b/src/module.c @@ -11825,7 +11825,7 @@ int moduleRegisterApi(const char *funcname, void *funcptr) { * so that legacy Redis module binaries can continue to function */ #define REGISTER_API(name) \ moduleRegisterApi("ValkeyModule_" #name, (void *)(unsigned long)VM_ ## name);\ - moduleRegisterApi("ValkeyModule_" #name, (void *)(unsigned long)VM_ ## name);\ + moduleRegisterApi("RedisModule_" #name, (void *)(unsigned long)VM_ ## name);\ /* Global initialization at Redis startup. */ void moduleRegisterCoreAPI(void);