Skip to content

Commit

Permalink
pyosys: dereference cpp objects when constructing a tuple
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
georgerennie committed Nov 15, 2024
1 parent bbb6bbd commit 583eb1a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions misc/py_wrap_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 583eb1a

Please sign in to comment.