danix800 added a comment. We have `getDynamicExtentWithOffset` to use, which can handle more general dynamic memory based cases than this fix.
I'll abandon this one. There are issues worth clarifying and fixing: 1). Debugging APIs like `clang_analyzer_dumpExtent` in `ExprInspection` might be expanded to use `getDynamicExtentWithOffset` if it's intended to be used on not only dynamic allocated regions but more general ones, and more testcases are needed to demonstrate the usage. 2). Fix type-inconsistency of several size-related `SVal`s, e.g. FAM fam; clang_analyzer_dump(clang_analyzer_getExtent(&fam)); clang_analyzer_dump(clang_analyzer_getExtent(fam.data)); // expected-warning@-2 {{4 S64b}} // U64b is more reasonable when used as an extent // expected-warning@-2 {{0 U64b}} `ArrayIndexType` might be misused here. Simple searching results listed here (might not be complete): 1. `getDynamicExtentWithOffset` return value 2. `getElementExtent` return value 3. `ExprEngineCallAndReturn.cpp` when calling `setDynamicExtent` the `Size` arg Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D158499/new/ https://reviews.llvm.org/D158499 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits