Skip to content
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

Prevent stack-use-after-scope in rendering_device_driver_metal.mm #98983

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

Conversation

nikitalita
Copy link
Contributor

This fixes a stack-use-after-scope error that I was getting on MacOS with sanitizers:

image

The problem is when it tries to get a reference from get_entry_points_and_stages().front(), but since the SmallVector that get_entry_points_and_stages() passes back is dynamically created, it deconstructs right after front() passes back that reference, thus we keep a reference to something that is no longer in scope.

image

Keeping that vector in scope fixes the issue.

asan.log

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

Successfully merging this pull request may close these issues.

2 participants