mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user