Skip to content
This repository was archived by the owner on Aug 5, 2026. It is now read-only.

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

Open
aaronj0 wants to merge 1 commit into
compiler-research:masterfrom
aaronj0:fix-ctor-call
Open

adapt to changes in JitCall, use InvokeConstructor in CallWrapper, #149
aaronj0 wants to merge 1 commit into
compiler-research:masterfrom
aaronj0:fix-ctor-call

Conversation

@aaronj0

@aaronj0 aaronj0 commented Jun 12, 2025

Copy link
Copy Markdown
Collaborator

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
Comment thread clingwrapper/src/clingwrapper.cxx Outdated
});
} else if (JC.getKind() == Cpp::JitCall::kConstructorCall) {
invokeHelper([&](void** buf, size_t count) {
JC.InvokeConstructor(result, 1UL, {buf, count}, self);

Copy link
Copy Markdown
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.

@aaronj0 aaronj0 Jun 12, 2025

Copy link
Copy Markdown
Collaborator Author

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
Copy Markdown
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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants