Berry C mapping, raise an error if too many arguments are sent (#20604)

This commit is contained in:
s-hadinger 2024-01-27 11:59:45 +01:00 committed by GitHub
parent 57e633ba55
commit 19b9960168
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 0 deletions

View File

@ -19,6 +19,7 @@ All notable changes to this project will be documented in this file.
- Utouch optimizations, rgb i2c init (#20596) - Utouch optimizations, rgb i2c init (#20596)
### Fixed ### Fixed
- Berry C mapping, raise an error if too many arguments are sent
### Removed ### Removed

View File

@ -360,6 +360,9 @@ int be_check_arg_type(bvm *vm, int arg_start, int argc, const char * arg_type, i
} }
} }
// berry_log_C(">> be_call_c_func arg %i, type %s", i, arg_type_check ? type_short_name : "<null>"); // berry_log_C(">> be_call_c_func arg %i, type %s", i, arg_type_check ? type_short_name : "<null>");
if (arg_type_check && type_short_name[0] == 0) {
be_raisef(vm, "value_error", "Too many arguments");
}
p[p_idx] = be_convert_single_elt(vm, i + arg_start, arg_type_check ? type_short_name : NULL, (int*)&buf_len); p[p_idx] = be_convert_single_elt(vm, i + arg_start, arg_type_check ? type_short_name : NULL, (int*)&buf_len);
// berry_log_C("< ret[%i]=%i", p_idx, p[p_idx]); // berry_log_C("< ret[%i]=%i", p_idx, p[p_idx]);
p_idx++; p_idx++;