From 583eb1addb82b033647aaee150ee02acd1d9e9fd Mon Sep 17 00:00:00 2001 From: George Rennie Date: Fri, 15 Nov 2024 15:15:42 +0100 Subject: [PATCH] pyosys: dereference cpp objects when constructing a tuple * This fixes a bug where when converting a tuple from python to c++, get_cpp_obj() was called (returning a pointer) without dereferencing the pointer to get the underlying object --- misc/py_wrap_generator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/misc/py_wrap_generator.py b/misc/py_wrap_generator.py index b0ac1e82e0e..6715951fc67 100644 --- a/misc/py_wrap_generator.py +++ b/misc/py_wrap_generator.py @@ -515,11 +515,11 @@ def translate(c, varname, types, prefix): if types[0].name.split(" ")[-1] in primitive_types: text += varname + "___tmp_0, " else: - text += varname + "___tmp_0.get_cpp_obj(), " + text += "*" + varname + "___tmp_0.get_cpp_obj(), " if types[1].name.split(" ")[-1] in primitive_types: text += varname + "___tmp_1);" else: - text += varname + "___tmp_1.get_cpp_obj());" + text += "*" + varname + "___tmp_1.get_cpp_obj());" return text #Generate c++ code to translate to a boost::python::tuple