=?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); ---------------- DonatNagyE wrote: Good point, I'm not familiar enough with move use to spot situations where it's needed. (I'll also consider refactoring the code, because the `reportOOB()` call becomes very long with the addition of the moves. Perhaps I'll just pessimize the code and allow it to call `getRegionName()` twice, because passing around the region name string seems to be a premature optimization.) 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