Skip to content

Commit

Permalink
Merge pull request #233 from chaoticgd/demangle_cast
Browse files Browse the repository at this point in the history
Use static_cast instead of reinterpret_cast for demangler cleanup
  • Loading branch information
chaoticgd authored Aug 29, 2024
2 parents 1e8bbf5 + 913fe54 commit c093a84
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/ccc/stabs_to_ast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ static MemberFunctionInfo check_member_function(
char* demangled_name = demangler.cplus_demangle_opname(mangled_name.c_str(), 0);
if(demangled_name) {
info.name = demangled_name;
free(reinterpret_cast<void*>(demangled_name));
free(static_cast<void*>(demangled_name));
}
}
if(info.name.empty()) {
Expand Down
2 changes: 1 addition & 1 deletion src/ccc/symbol_database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ Result<SymbolType*> SymbolList<SymbolType>::create_symbol(
char* demangled_name_ptr = demangler.cplus_demangle(name.c_str(), demangler_flags);
if(demangled_name_ptr) {
demangled_name = demangled_name_ptr;
free(reinterpret_cast<void*>(demangled_name_ptr));
free(static_cast<void*>(demangled_name_ptr));
}
}
}
Expand Down

0 comments on commit c093a84

Please sign in to comment.