Repository navigation
Reject extension reductions that return themselves or null - #578
Merged
Merged
Conversation
Guard self/null reductions in both collection and emission. Keep strict null/exception contracts and ordinary valid reductions. Regression reducers are bounded so the pre-fix reproduction cannot hang.
Owner
|
nice clean catch, thank you. |
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.
A custom Extension node whose Reduce() returns itself loops in the collector/emitter; a null reduction reaches a NullReferenceException. Guard both reduction sites and follow FEC's existing strict rejection contract: null/false, or NotSupportedExpressionException where the collection flags request it. Normal System fallback retains its validation exception.
Two local guards (8 inserted production lines); no new traversal, public API or closure changes. The deliberately broken test reducer is bounded, so the pre-fix test reports a failure rather than hanging.
This is an independent extraction from #558, based directly on master
4683482e929f98a528b12a1c7fee8e232ecc36c2. It has one commit and does not depend on either of the other standalone fixes. #558 and #559 are unchanged.Validation
ParityTests.Binary_operators_with_methods_and_nullable_operands_are_the_same_as_systemfor nullable MultiplyChecked in both input variants. The identical failures reproduce on unmodified master. No other fixture failures were observed; the legacy suites were invoked separately because this existing TestX failure gates the normal runner.Performance checks
Measured against current master on Windows ARM64, SDK 10.0.301, .NET 8.0.28/10.0.9, Release; tiered compilation disabled and a fixed CPU affinity. Expression construction/conversion is outside the timed compilation. Only inputs that already compile correctly on master are compared.
For each input, compilation uses two opposite-load-order processes and nine alternating samples per side (about a 100 ms calibration target per pair). The table combines process medians geometrically. Invocation uses nine alternating samples.
All measured controls allocate the same managed bytes per compilation and zero bytes per invocation; decoded control IL is identical before/after. Compilation timing is mixed/noisy, including slower rows below. The identical-binary master/master control itself ranged from -9.9% to +6.0%. These measurements do not establish zero compilation slowdown, and no speedup claim is made. Runtime nanosecond differences are observations of identical emitted control IL.