| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
Several summaries lose flow through modifiable return references and assignment results.
Get a fresh assessment by requesting another Copilot review.
Pull request overviewAdds contained-value flow modeling for BDE nullable and variant wrappers.
Changes:
| File | Description |
|---|---|
| cpp/ql/lib/semmle/code/cpp/models/Models.qll | Registers the new implementation. |
| cpp/ql/lib/semmle/code/cpp/models/implementations/BdlbValues.qll | Implements assignment and emplacement summaries. |
| cpp/ql/lib/ext/bdlb.values.model.yml | Declares accessor and copy/move models. |
| cpp/ql/lib/change-notes/2026-09-14-bdlb-values.md | Documents the analysis improvement. |
| cpp/ql/test/library-tests/dataflow/bdlb-values/wrappers.h | Defines reduced BDE test APIs. |
| cpp/ql/test/library-tests/dataflow/bdlb-values/test.cpp | Tests wrapper data flow. |
| cpp/ql/test/library-tests/dataflow/bdlb-values/emplacement.cpp | Tests constructor-body analysis. |
| cpp/ql/test/library-tests/dataflow/bdlb-values/flow.ql | Configures the flow test. |
| cpp/ql/test/library-tests/dataflow/bdlb-values/flow.expected | Records expected results. |
| cpp/ql/test/library-tests/dataflow/external-models/validatemodels.expected | Updates model-validation expectations. |
cpp/ql/lib/semmle/code/cpp/models/implementations/BdlbValues.qll:85
output = ["Argument[-1].Element[" + stars + "]", "ReturnValue[*" + stars + "]"]
cpp/ql/lib/ext/bdlb.values.model.yml:14
- ["BloombergLP::bdlb", "NullableValue", False, "operator=", "(NullableValue &&)", "", "Argument[*0].Element[@]", "Argument[-1].Element[@]", "value", "manual"]
cpp/ql/lib/ext/bdlb.values.model.yml:19
- ["BloombergLP::bdlb", "VariantImp", False, "operator=", "(const VariantImp &)", "", "Argument[*0].Element[@]", "Argument[-1].Element[@]", "value", "manual"]
cpp/ql/lib/ext/bdlb.values.model.yml:21
- ["BloombergLP::bdlb", "VariantImp", False, "operator=", "(VariantImp &&)", "", "Argument[*0].Element[@]", "Argument[-1].Element[@]", "value", "manual"]
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Sorry, something went wrong.
Fix both P2 findings: propagate copy/move assignment contents to the returned wrapper reference, and preserve writes through makeValue and scalar emplacement results. Add seven regression cases with destination-read controls. Wrapper flow tests, model validation, and QL formatting pass.
Address the two P2 findings from the independent review of PR github#22581. Restrict scalar emplacement summaries to arithmetic or pointer inputs so user-defined conversions retain body analysis. Model copy/move assignment results as aliases of the receiver. Add positive and negative conversion regressions and write-through tests for both assignment forms and wrappers. Wrapper flow tests and model validation pass.
There was a problem hiding this comment.
The summaries omit valid pointer conversions and several C++ scalar emplacement categories.
Get a fresh assessment by requesting another Copilot review.
Review detailscpp/ql/lib/semmle/code/cpp/models/implementations/BdlbValues.qll:88
(inputType instanceof ArithmeticType or inputType instanceof PointerType) and
storedType =
this.getType().getUnspecifiedType().(ReferenceType).getBaseType().getUnspecifiedType() and
(storedType instanceof ArithmeticType or storedType instanceof PointerType) and
Sorry, something went wrong.
Track contained values through NullableValue and VariantImp accessors, copy/move operations, assignment, and scalar emplacement. Preserve assignment-result aliasing, returned-reference writes, and exact-type pointer payloads. Leave user-defined conversions and emplacement constructors available for body analysis. Add regressions for scalar, pointer and aggregate payloads; copy/move result reads and writes; arithmetic conversions; and constructors and conversions that use or ignore their inputs. Wrapper flow tests and external model validation pass.
| Back | FazBrowse Home | New Git URL |
Adds contained-value flow models for BDE bdlb::NullableValue and the bdlb::Variant family.
Covers accessors (value, the, valueOr, addressOr, valueOrNull), makeValue / assign, same-specialization copy and move operations, allocator-extended constructors, and single-argument arithmetic, enum, and pointer emplacement.
Simple reads use YAML summaries; type-dependent flow and write-back through returned references/pointers use QL summaries. Inherited optional operators are handled separately in #22582.
Class-typed and multi-argument emplacement, engagement state, and C++03 move emulation are outside this change.