Skip to content

Commit

Permalink
Fix switch case compilation error in the new helloscripting (#1472)
Browse files Browse the repository at this point in the history
It is missing the curly braces for variable declaration after case.

Signed-off-by: Binbin <[email protected]>
  • Loading branch information
enjoy-binbin authored Dec 22, 2024
1 parent 6adef8e commit d00c856
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/modules/helloscripting.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,18 +213,20 @@ static uint32_t executeHelloLangFunction(HelloFunc *func,
case CONSTI:
stack[sp++] = instr.param.integer;
break;
case ARGS:
case ARGS: {
uint32_t idx = instr.param.integer;
ValkeyModule_Assert(idx < (uint32_t)nargs);
size_t len;
const char *argStr = ValkeyModule_StringPtrLen(args[idx], &len);
uint32_t arg = str2int(argStr);
stack[sp++] = arg;
break;
case RETURN:
}
case RETURN: {
uint32_t val = stack[--sp];
ValkeyModule_Assert(sp == 0);
return val;
}
case FUNCTION:
default:
ValkeyModule_Assert(0);
Expand Down

0 comments on commit d00c856

Please sign in to comment.