Return gdbpy_ref<> from gdbarch_to_arch_object

This changes gdbarch_to_arch_object to return a gdbpy_ref<>,
using the type system to convey that a new reference is always
returned.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
This commit is contained in:
Tom Tromey 2026-02-20 13:20:56 -07:00
parent 472748485e
commit a93acde059
7 changed files with 8 additions and 8 deletions

View file

@ -1421,7 +1421,7 @@ gdbpy_colorize_disasm (const std::string &content, gdbarch *gdbarch)
return {};
}
gdbpy_ref<> gdbarch_arg (gdbarch_to_arch_object (gdbarch));
gdbpy_ref<> gdbarch_arg = gdbarch_to_arch_object (gdbarch);
if (gdbarch_arg == nullptr)
{
gdbpy_print_stack ();