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

fix: correctly trace cppgc proto objects#1113

Merged
devsnek merged 1 commit into
mainfrom
x/fix-cppgc-proto-tracing
Apr 7, 2025
Merged

fix: correctly trace cppgc proto objects#1113
devsnek merged 1 commit into
mainfrom
x/fix-cppgc-proto-tracing

Conversation

@devsnek
Copy link
Copy Markdown
Member

@devsnek devsnek commented Apr 7, 2025

The bug specifically was this code: ptr.ptr.trace(visitor);. It is not correct to directly call foo.trace(visitor), since you are skipping the visitor's marking logic when you do that. You have to do visitor.trace(&foo).

In order to fix this, the impl of ErasedPtr was switched to use Member<T>, which is in fact the correct type to use for strong references to other cppgc objects.

Fixes: #1112

@devsnek devsnek requested a review from littledivy April 7, 2025 15:23
Copy link
Copy Markdown
Member

@littledivy littledivy left a comment

Choose a reason for hiding this comment

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

LGTM!

@devsnek devsnek enabled auto-merge (squash) April 7, 2025 15:29
@devsnek devsnek merged commit 971cf87 into main Apr 7, 2025
18 checks passed
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.

cppgc proto object gc'ed while in use

2 participants