{ "tokens": { "input": 9635, "cache_read": 10345, "cache_write": 2069, "output": 2658 }, "reviews": [ { "key": [ "https://ftp.debian.org/debian/pool/main/c/cura-engine/cura-engine_5.0.0.orig.tar.gz", "main CuraEngine-5.0.0/src/utils/ListPolyIt.cpp:74:26: error: Returning object that points to local variable 'after' that will be invalid when returning. [returnDanglingLifetime]\n CuraEngine-5.0.0/src/utils/ListPolyIt.cpp:73:27: note: Assigned to reference.\n CuraEngine-5.0.0/src/utils/ListPolyIt.cpp:74:27: note: Passed to constructor of 'ListPolyIt'.\n CuraEngine-5.0.0/src/utils/ListPolyIt.cpp:61:90: note: Variable created here.\n CuraEngine-5.0.0/src/utils/ListPolyIt.cpp:74:26: note: Returning object that points to local variable 'after' that will be invalid when returning." ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "`after.poly` is a pointer member of ListPolyIt (`ListPolygon* poly`). `*after.poly` dereferences that pointer, so the reference `poly` refers to an external ListPolygon, not to storage inside the local parameter `after`. Returning a ListPolyIt built from it does not dangle. The PR's checkDotLifetime stops treating `*x.member` as a lifetime of `x` unless the member is an array. That removes this false positive." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/f/fastnetmon/fastnetmon_1.2.9.orig.tar.gz", "main pavel-odintsov-fastnetmon-394fbe0/src/fmt/base.h:508:10: error: Reference to temporary returned. [returnTempReference]" ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "`*accessor(it).container` dereferences the `container` pointer member of a temporary (in std::back_insert_iterator, `container` is a pointer). The returned reference points to the external container, not to the temporary, so the old returnTempReference warning was a false positive. The PR only treats `*x.member` as pointing into x when the member is an array, which removes this warning correctly." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/k/kf6-syntax-highlighting/kf6-syntax-highlighting_6.30.0.orig.tar.xz", "main syntax-highlighting-6.30.0/src/indexer/katehighlightingindexer.cpp:2224:20: style: Variable 'observedRule' can be declared as reference to const [constVariableReference]" ], "verdict": { "verdict": "acceptable regression", "confidence": "medium", "explanation": "In the loop `for (auto &observedRule : observedRules)`, `observedRule` is only read in the code shown: `*observedRule.rule` dereferences a pointer member, and the rest of the visible loop uses `rule`. So `const auto &` would work, and the main warning is very likely a true positive. The PR changes lifetime tracking for `*x.member` when the member is not an array. `rule` no longer gets its lifetime from `observedRule`, which is semantically more correct, but it seems to make the constness analysis more conservative. The result is that this valid style suggestion is lost: a new false negative, not a new false positive. The full loop body is not shown, so a later write to `observedRule` cannot be ruled out." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/p/pdal/pdal_2.2.0+ds.orig.tar.xz", "main PDAL-2.2.0/vendor/pdalboost/libs/serialization/src/basic_oarchive.cpp:231:12: error: Reference to local variable returned. [returnReference]" ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "`cresult` is a `std::pair`, so `cresult.first` is a set iterator. Dereferencing it gives a reference to an element stored in the member `cobject_info_set`, not a reference to the local pair. Returning `*(cresult.first)` is therefore safe and the old returnReference warning was a false positive. The PR now only follows `.` through `*` when the member is an array, so the iterator member no longer counts as part of the local's lifetime." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/p/pdal/pdal_2.2.0+ds.orig.tar.xz", "main PDAL-2.2.0/vendor/pdalboost/libs/serialization/src/basic_oarchive.cpp:241:12: error: Reference to local variable returned. [returnReference]" ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "`result.first` is a set iterator, and `*(result.first)` dereferences it to get a reference to an element stored in the member `cobject_info_set`. It is not a reference to the local `result`. Main treated `*result.first` as referring to the local variable, which was a false positive. The PR stops this unless the dereferenced member is an array, so the warning goes away correctly." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/s/sumo/sumo_1.27.1+dfsg.orig.tar.xz", "your sumo-1_27_1/src/netimport/NIImporter_OpenDrive.cpp:1737:104: style: Parameter 'edges' can be declared as reference to const [constParameterReference]" ], "verdict": { "verdict": "improvement", "confidence": "medium", "explanation": "`edges` is a map of `OpenDriveEdge*`. The loop takes `const auto& i` and writes only through `*i.second`, i.e. to the pointed-to edge, not to the map. Before the PR, the lifetime of `*i.second` was traced back to `i` and therefore to `edges`. Writes through `e` then counted as modifying the map, which suppressed the warning. With the PR, dereferencing a non-array pointer member no longer inherits the container's lifetime, so Cppcheck correctly sees that the map itself is not modified. `const std::map<...>&` would compile in the visible code. Confidence is medium because the end of the function is not shown, but nothing visible modifies `edges`, so this looks like a correct new true positive." } } ], "started": "2026-11-03 22:50:35 UTC", "runner": "aws-testrunner-1" }