Browse Source

Fixed a tricky bug that was breaking generation of vtables interop code.

The generation problem manifested as duplication of methods in the AST which was breaking the numbering logic and caused duplicated delegates.

The root problem was that in the parser we sometimes would walk through methods but forget to add them to their respective classes.

No test because it's tricky to trigger it.
pull/103/head
triton 12 years ago
parent
commit
9bb39e92eb
  1. 3
      src/CppParser/Parser.cpp
  2. 3
      src/Parser/Parser.cpp

3
src/CppParser/Parser.cpp

@ -616,7 +616,6 @@ Class* Parser::WalkRecordCXX(clang::CXXRecordDecl* Record) @@ -616,7 +616,6 @@ Class* Parser::WalkRecordCXX(clang::CXXRecordDecl* Record)
auto Method = WalkMethodCXX(MD);
HandleDeclaration(MD, Method);
Method->AccessDecl = AccessDecl;
RC->Methods.push_back(Method);
break;
}
case Decl::Field:
@ -812,6 +811,8 @@ Method* Parser::WalkMethodCXX(clang::CXXMethodDecl* MD) @@ -812,6 +811,8 @@ Method* Parser::WalkMethodCXX(clang::CXXMethodDecl* MD)
{
}
Class->Methods.push_back(Method);
return Method;
}

3
src/Parser/Parser.cpp

@ -619,7 +619,6 @@ CppSharp::AST::Class^ Parser::WalkRecordCXX(clang::CXXRecordDecl* Record) @@ -619,7 +619,6 @@ CppSharp::AST::Class^ Parser::WalkRecordCXX(clang::CXXRecordDecl* Record)
auto Method = WalkMethodCXX(MD);
HandleDeclaration(MD, Method);
Method->AccessDecl = AccessDecl;
RC->Methods->Add(Method);
break;
}
case Decl::Field:
@ -817,6 +816,8 @@ CppSharp::AST::Method^ Parser::WalkMethodCXX(clang::CXXMethodDecl* MD) @@ -817,6 +816,8 @@ CppSharp::AST::Method^ Parser::WalkMethodCXX(clang::CXXMethodDecl* MD)
{
}
Class->Methods->Add(Method);
return Method;
}

Loading…
Cancel
Save