refactor(thread_pool): drop the -Wmaybe-uninitialized pragma; fix it properly (true-async/server#93)#178
Merged
Conversation
…le the setjmp-live locals + split the nested zend_try blocks into guarded helpers (true-async/server#93)
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #177. That PR silenced GCC
-O2 -Wmaybe-uninitializedinthread_pool_worker_handlerwith a blanket#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"over the whole function — a poor tool: it hides any future real uninitialized-variable bug there. This replaces it with proper, targeted fixes (no pragma, noZend/change):volatileon the five loop-locals that live across the loop'szend_try(state,snapshot,worker_coro,task_scope,body_bailed) — the C 7.13.2.1-correct fix for setjmp-live automatics.zend_tryblocks (the bootloader call and the body await) into small guarded helpers (thread_pool_call_guarded,thread_pool_suspend_guarded). GCC's misfire on thezend_trymacro's own__orig_bailoutonly happens across nestedzend_try; with no nesting it's gone.Result: zero
-O2warnings in the file, no suppression, no core change.thread_poolsuite 78/79 (the one WARN is the pre-existing XFAIL-that-passes), behavior unchanged.