Preserve pointee aliases through owning-pointer get() #255
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #255"
general
weight: 0.35
ArcsinX
Bodyless std::shared_ptr<T>::get() and std::unique_ptr<T>::get() lost the pointee value already available through operator->. A callback read through p.get()->callback could therefore have no target while p->callback reached alpha. Keep a single extraction recognizer for result typing and value lowering, retaining the external getter call site and rejecting unrelated get methods and calls with arguments.
Reuse UnwrapPointer for raw-pointer extraction, resolving the destination's pointee declaration before applying the existing compatibility filter. This preserves aliases without introducing heap allocations, wrapper-object aliases or incompatible pointees, including when converting to void . Route assignments, arguments, dereferences, returns and chained accesses through the ordinary expression-value machinery.
Intern wrapper descriptors needed by isolated reference/pointer receivers. Record reference returns from declarations and definitions, share overload selection with result typing, and load a reference-returned wrapper before extracting its pointee. Preserve both interpretations when unresolved overloads allow reference and value returns; do not add a load for a known value return.
Settle executable getter definitions before expression lowering and retain visibility through type-only header imports, including later out-of-line and separately lowered definitions. Recheck provisional extraction flows after merging with the shared image-aware resolver. Keep excluded dependency bodies declaration-only and preserve ordinary implementation returns. File-scope initializers use the destination's target when no caller exists; an executable getter receives an ordinary CallReturn in that image instead of retaining a provisional unwrap. Preserve provenance and retained flow ranges when settling those facts.
Add a reduced fixture and isolated regressions covering both wrappers, qualified calls, reference-only/pointer-only receivers, fields, returned wrappers, reference returns, raw/dereferenced arguments, casts, constructor arguments, negative controls and pointee filtering. Check later/shared-header implementations and global/local extractions across independent link images, including implementations supplied by another TU in the same image.
Update the changelog, README, contributor guide, C++ roadmap, analysis rules and unwrap-edge documentation. Consolidate the evaluation report around the final measurements and remaining independent task/bind/template limits. Refresh only HiView's argument-flow expectation center and add focused HDF and HiView production probes.
Validation:
Preserve value-form reference returns in wrapper receivers
Receiver normalization assumed that every reference-returned wrapper held its address and unconditionally loaded through it. ReturnFlow::Copy still represents named and field reference returns as wrapper values, so this load discarded concrete pointees that ref().lock() retained before #247. The same mismatch affected owning-pointer ref().get().
Conservatively keep the original return value alongside the loaded value whenever a viable declaration returns a reference. This handles both address-form returns such as return p and value-form returns such as return global or return field, without changing return-flow lowering. Known value returns still receive no extra load. Subsequent owning-pointer unwraps retain their existing compatibility filter, excluding wrapper storage and incompatible objects. Simplify the overload helper to report whether a reference return is possible.
Add exact-pointee regressions for shared_ptr and unique_ptr extraction, and verify that reference-returned std::weak_ptr::lock() and OHOS wptr::promote() preserve the concrete pointee without a subsequent get(). Cover named, qualified, const/rvalue, forwarded, implicit/explicit field, dereferenced and bound-reference returns, with value-returning controls. Update the analysis rules, changelog and evaluation report.
Validation:
Resolve getter definitions through imported wrapper declarations
Register owning-pointer class declarations before the getter-definition prepass resolves out-of-line owners through namespace directives. Interned tags alone were invisible to declared-class lookup, allowing provisional get() summaries to add stored pointees despite executable getter bodies.
Register local shared_ptr/unique_ptr namesakes too so the shared resolver preserves namespace shadowing and unrelated getters cannot suppress the standard templates' extraction summaries.
Add exact-pointee regressions for both owning wrappers, std and ::std namespace directives, definitions before/after callers, and local namesakes. Update the analysis documentation, changelog, and evaluation report.
Validation: cargo test --workspace (2,637 passed), cargo fmt --all --check, and git diff --check. Fresh pinned-corpus checks and deterministic export comparisons are recorded in docs/EVAL_REPORT.md.
Closes #247