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

Fix reversed conditions in ObjectOptimizer::calculateCacheKey() #15909

Merged

Conversation

cameel
Copy link
Member

@cameel cameel commented Mar 2, 2025

Fixes #15871.

The cache key calculation was using reversed values for boolean flags. This was unintended, but wasn't really breaking anything on its own since they can't be read back and it only matters that they are unique. Actual problems started in #15467, where a new entry was based on the incorrect condition, putting code dereferencing an optional in the wrong branch.

This started failing a debug assertion in STL, but fortunately does not seem like it could lead to broken output. If the value that ends up getting stored is zero, it will result in EOF and non-EOF compilation getting the same cache key, but it's currently not possible to mix them. If the value is some random garbage from memory, it will lead to identical objects getting different keys, bypassing the cache, but we haven't observed this kind of degradation in benchmarks so far.

clonker
clonker previously approved these changes Mar 3, 2025
@cameel cameel force-pushed the fix-reversed-conditions-in-object-optimizer-cache-key branch from 4ccf599 to 45add19 Compare March 3, 2025 17:06
clonker
clonker previously approved these changes Mar 3, 2025
@cameel cameel force-pushed the fix-reversed-conditions-in-object-optimizer-cache-key branch from 1842cfa to c9aa6f4 Compare March 3, 2025 18:50
@cameel cameel enabled auto-merge March 3, 2025 18:50
@cameel cameel merged commit 1965d74 into develop Mar 3, 2025
74 checks passed
@cameel cameel deleted the fix-reversed-conditions-in-object-optimizer-cache-key branch March 3, 2025 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants