1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Fix bug in ctx_set_local_type()

This commit is contained in:
Maxime Chevalier-Boisvert 2021-04-09 14:48:02 -04:00 committed by Alan Wu
parent 6164274c76
commit 53ff2d791d

View file

@ -202,7 +202,7 @@ Set the type of a local variable
*/
void ctx_set_local_type(ctx_t* ctx, size_t idx, val_type_t type)
{
if (ctx->stack_size > MAX_LOCAL_TYPES)
if (idx >= MAX_LOCAL_TYPES)
return;
ctx->local_types[idx] = type;