[PATCH] D16044: getDescriptiveName() for MemRegion

Gábor Horváth via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 30 11:00:44 PDT 2016


xazax.hun added inline comments.

================
Comment at: lib/StaticAnalyzer/Core/MemRegion.cpp:653
@@ +652,3 @@
+    // name by calling 'getDescriptiveName' recursively.
+    else {
+      std::string Idx = ER->getDescriptiveName(false);
----------------
Alexander_Droste wrote:
> I wasn't able to build a test case yet for which the analyzer could not determine the constant value. Is there a way to trick the analyzer so that the else case is used ? Then I could test for something like `'sendReq1[a][7][b]'`.
You can try use a value returned from a function that has an unknown body. E.g.:

int getUnknown();

void f() {
  int a = getUnKnown();
}


http://reviews.llvm.org/D16044





More information about the cfe-commits mailing list