binaryninja: prefer stack allocation

This commit is contained in:
Romain Thomas
2026-10-03 11:50:41 +02:00
parent 9baa88634c
commit 0c629d5f72
2 changed files with 2 additions and 7 deletions
@@ -101,13 +101,11 @@ dw::Function* FunctionEngine::add_function(BN::Function& func) {
std::unique_ptr<dw::Variable> dw_var =
dw_func->create_stack_variable(info.name);
auto location = std::make_unique<LIEF::dwarf::FrameBaseLoc>(addr);
if (auto var_type = info.type; api_compat::as_bool(var_type)) {
dw::Type& dw_type = types_.add_type(api_compat::get_type(var_type));
dw_var->set_type(dw_type);
}
dw_var->set_location(*location);
dw_var->set_location(LIEF::dwarf::FrameBaseLoc(addr));
}
}
std::vector<uint64_t> commented_addresses = func.GetCommentedAddresses();
@@ -52,11 +52,8 @@ dw::Variable* VarEngine::add_variable(const BN::DataVariable& var) {
std::unique_ptr<dw::Variable> dw_var = unit_.create_variable(name);
auto location = std::make_unique<LIEF::dwarf::AddressLoc>(var.address);
dw_var->set_type(types_.add_type(api_compat::get_type(var.type)));
dw_var->set_location(*location);
dw_var->set_location(LIEF::dwarf::AddressLoc(var.address));
std::string comment = bv_.GetCommentForAddress(var.address);
if (!comment.empty()) {