=?utf-8?q?Donát?= Nagy <donat.n...@ericsson.com>, =?utf-8?q?Donát?= Nagy <donat.n...@ericsson.com> Message-ID: In-Reply-To: <llvm.org/llvm/llvm-project/pull/70...@github.com>
================ @@ -217,80 +326,71 @@ void ArrayBoundCheckerV2::checkLocation(SVal location, bool isLoad, // MallocChecker that call SValBuilder::getConjuredHeapSymbolVal()) and // non-symbolic regions (e.g. a field subregion of a symbolic region) in // unknown space. - auto [state_precedesLowerBound, state_withinLowerBound] = - compareValueToThreshold(state, ByteOffset, - svalBuilder.makeZeroArrayIndex(), svalBuilder); + auto [PrecedesLowerBound, WithinLowerBound] = compareValueToThreshold( + State, ByteOffset, SVB.makeZeroArrayIndex(), SVB); - if (state_precedesLowerBound && !state_withinLowerBound) { + if (PrecedesLowerBound && !WithinLowerBound) { // We know that the index definitely precedes the lower bound. - reportOOB(checkerContext, state_precedesLowerBound, OOB_Precedes); + std::string RegName = getRegionName(Reg); + std::string Msg = getPrecedesMsg(RegName, ByteOffset); + reportOOB(C, PrecedesLowerBound, OOB_Precedes, ByteOffset, RegName, Msg); ---------------- steakhal wrote: To me, `move` describes the intent: I produced something, and this is the only place that is supposed to consume it. Keep in mind that this code is cold, thus we can do whatever we want, including making unnecessary copies. BTW I didn't see that the result of the first is actually used for the second call. This way this code makes all sense. https://github.com/llvm/llvm-project/pull/70056 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits