Skip to content

adapt to changes in JitCall, use InvokeConstructor in CallWrapper, #149

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aaronj0
Copy link
Collaborator

@aaronj0 aaronj0 commented Jun 12, 2025

Follow up of compiler-research/CppInterOp#587 that prevents crashes in cppyy when calling Invoke with a constructor

@aaronj0 aaronj0 requested a review from vgvassilev June 12, 2025 11:48
});
} else if (JC.getKind() == Cpp::JitCall::kConstructorCall) {
invokeHelper([&](void** buf, size_t count) {
JC.InvokeConstructor(result, 1UL, {buf, count}, self);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought that case can still go via Invoke.

Copy link
Collaborator Author

@aaronj0 aaronj0 Jun 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

correct, the culprit was https://github.com/compiler-research/CppInterOp/blob/5274fd8f517bcd94104dd31d022daf08e1071c19/include/CppInterOp/CppInterOp.h#L176 where the !args.m_Args condition for destructors was checked for ctor calls. Thanks for catching that, I have updated the InterOp PR

}
};

invokeHelper(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably do not need the lambda if we call things only once.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants