mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-04 05:19:11 +00:00 
			
		
		
		
	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
This commit is contained in:
		
							parent
							
								
									bbb6bbd12a
								
							
						
					
					
						commit
						583eb1addb
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -515,11 +515,11 @@ class TupleTranslator(PythonDictTranslator):
 | 
			
		|||
		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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue