Skip to content

Commit

Permalink
Berry prevent 'import' from hiding a solidified class (#23112)
Browse files Browse the repository at this point in the history
  • Loading branch information
s-hadinger authored Mar 6, 2025
1 parent 72535db commit e26a2cd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 4 additions & 1 deletion lib/libesp32/berry/src/be_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit e26a2cd

Please sign in to comment.