mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
b460554d33
Replace check_method_noarg() with check_argument_count() that validates min <= argc <= max using the full aspec stored in mrb_method_t.flags. This catches ArgumentError earlier at dispatch time, before entering the C function. The old check only handled the special case of aspec==0 (NOARG). The new check extracts REQ, OPT, REST, POST, KEY, and KDICT from the aspec and validates accordingly. Keyword hash is counted as a positional arg only when the method doesn't accept keywords. Remove MRB_METHOD_NOARG_P macro from proc.h (subsumed by aspec check). Fix 15 incorrect aspec declarations across the codebase that were exposed by the stricter enforcement. Co-authored-by: Claude <noreply@anthropic.com>