Berry prevent 'import' from hiding a solidified class (#23112)

This commit is contained in:
s-hadinger 2025-03-06 14:45:34 +01:00 committed by GitHub
parent 72535db185
commit e26a2cdac9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

View File

@ -13,6 +13,7 @@ All notable changes to this project will be documented in this file.
- ESP32 enable webcam version 2 (#18732)
### Fixed
- Berry prevent `import` from hiding a solidified class
### Removed

View File

@ -488,7 +488,10 @@ static void new_var(bparser *parser, bstring *name, bexpdesc *var)
var->v.idx = new_localvar(parser, name); /* if local, contains the index in current local var list */
} else {
init_exp(var, ETGLOBAL, 0);
var->v.idx = be_global_new(parser->vm, name);
var->v.idx = be_global_find(parser->vm, name);
if (var->v.idx < 0) {
var->v.idx = be_global_new(parser->vm, name);
}
if (var->v.idx > (int)IBx_MASK) {
push_error(parser,
"too many global variables (in '%s')", str(name));