Merge pull request #71 from ValKmjolnir/develop
Some checks failed
Nasal Interpreter Test / mac-aarch64 (push) Has been cancelled
Nasal Interpreter Test / linux-x86_64 (push) Has been cancelled

🐛 fix memory leak
This commit is contained in:
ValK
2025-06-05 20:12:20 +08:00
committed by GitHub

View File

@@ -330,11 +330,11 @@ return_expr* linker::generate_module_return(code_block* block) {
auto value = new hash_expr(block->get_location());
result->set_value(value);
for (const auto& i : finder->do_find(block)) {
auto pair = new hash_pair(block->get_location());
// do not export symbol begins with '_'
if (i.name.length() && i.name[0]=='_') {
continue;
}
auto pair = new hash_pair(block->get_location());
pair->set_name(i.name);
pair->set_value(new identifier(block->get_location(), i.name));
value->add_member(pair);