diff options
author | John Hodge <tpg@mutabah.net> | 2017-02-02 22:34:02 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2017-02-02 22:34:02 +0800 |
commit | dd91f16e461c04bd4528c79f2ab5d96f8ac759e1 (patch) | |
tree | e5c6626ae1c441eafbd7b95b5df2e84e159ad72e | |
parent | 15790ac4aa2d99ebdc105bf3f7053d498f7541a5 (diff) | |
download | mrust-dd91f16e461c04bd4528c79f2ab5d96f8ac759e1.tar.gz |
Codegen C - Fix incorrect impl of Fn* for fn pointers
-rw-r--r-- | src/trans/codegen_c.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/trans/codegen_c.cpp b/src/trans/codegen_c.cpp index 4ea2e54d..73f068a3 100644 --- a/src/trans/codegen_c.cpp +++ b/src/trans/codegen_c.cpp @@ -1083,8 +1083,8 @@ namespace { auto arg_ty = ::HIR::TypeRef::new_unit(); for(const auto& ty : te->m_arg_types) arg_ty.m_data.as_Tuple().push_back( ty.clone() ); - m_of << " " << Trans_Mangle(fcn_p) << "("; emit_ctype(type, FMT_CB(ss, ss << "ptr";)); m_of << ", "; emit_ctype(arg_ty, FMT_CB(ss, ss << "args";)); m_of << ") {\n"; - m_of << "\treturn ptr("; + m_of << " " << Trans_Mangle(fcn_p) << "("; emit_ctype(type, FMT_CB(ss, ss << "*ptr";)); m_of << ", "; emit_ctype(arg_ty, FMT_CB(ss, ss << "args";)); m_of << ") {\n"; + m_of << "\treturn (*ptr)("; for(unsigned int i = 0; i < te->m_arg_types.size(); i++) { if(i != 0) m_of << ", "; |