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

Avoid double-free in functions cloned for vulkan relaxed mode #2987

Merged
merged 2 commits into from
Aug 3, 2022

Conversation

dneto0
Copy link
Contributor

@dneto0 dneto0 commented Jul 29, 2022

When rewriting function calls atomicCounterIncrement and
atoicCounterDecrement, clone the parameters so that the TParameter
'type' field is cloned. This avoids double-free when both the original
and transformed functions are deleted by the parser.

Fixes a ubsan failure.

When rewriting function calls atomicCounterIncrement and
atoicCounterDecrement, clone the parameters so that the TParameter
'type' field is cloned.  This avoids double-free when both the original
and transformed functions are deleted by the parser.

Fixes a ubsan failure.
Copy link
Contributor

@greg-lunarg greg-lunarg left a comment

Choose a reason for hiding this comment

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

Generally a good change.

There is one previous use of copyParam in SymbolTable.cpp. Should we stick a (void) before that call to signal we are not using the return value there?

@dneto0
Copy link
Contributor Author

dneto0 commented Aug 2, 2022

There is one previous use of copyParam in SymbolTable.cpp. Should we stick a (void) before that call to signal we are not using the return value there?

I've added a commit which does that.

@greg-lunarg greg-lunarg merged commit f28022c into KhronosGroup:master Aug 3, 2022
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