mruby-compiler: fix MRB_NO_STDIO build in codegen_pattern()

remove snprintf() call that requires <stdio.h>, which is unavailable
with MRB_NO_STDIO; use a static error message consistent with other
codegen_error() calls.

Fixes #6724.

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Yukihiro "Matz" Matsumoto
2026-02-25 14:11:08 +09:00
parent 06bce53132
commit 9e0eec3974
+1 -4
View File
@@ -4597,10 +4597,7 @@ codegen_pattern(codegen_scope *s, node *pattern, int target, uint32_t *fail_pos,
}
else {
/* Variable not found - raise compile error like CRuby */
const char *name = mrb_sym_name_len(s->mrb, pat_pin->name, NULL);
char buf[256];
snprintf(buf, sizeof(buf), "%.200s: no such local variable", name);
codegen_error(s, buf);
codegen_error(s, "no such local variable for pin operator");
}
}
break;