Skip to content

fix: preserve zero-offset base loads - #6335

Open
henryiii wants to merge 1 commit into
pybind:masterfrom
henryiii:henryiii/fix/zero-offset-base-loads
Open

henryiii wants to merge 1 commit into
pybind:masterfrom
henryiii:henryiii/fix/zero-offset-base-loads

Conversation

@henryiii

@henryiii henryiii commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator

🤖 AI text below 🤖

Description

Binding one subclass with py::multiple_inheritance() can make pybind11 reject valid loads from a zero-offset sibling or child. After trying the registered C++ casts, reuse the instance slot when the base path has zero offset and any required holder storage is compatible.

This is the standalone compatibility fix extracted from #6296.

Codex (GPT-6) extracted the change. Four regression cases fail against unmodified master and pass with this fix.

Suggested changelog entry:

  • Preserve zero-offset base loads when another subclass requires pointer adjustment.

Assisted-by: Codex:GPT-6

Reuse a compatible instance slot when a base requires no pointer adjustment and registered casts cannot load it. This preserves valid loads after another subclass marks the base as non-simple.

Assisted-by: Codex:GPT-6

This branch has not been deployed

No deployments
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.

1 participant