Charusso added inline comments.

================
Comment at: clang/lib/StaticAnalyzer/Checkers/CastValueChecker.cpp:61
+
+  return Ty.getAsString();
+}
----------------
NoQ wrote:
> Use after free! `QualType::getAsString()` returns a temporary `std::string`. 
> You're returning a `StringRef` that outlives the string it refers to. The 
> solution is usually to return the `std::string` by value.
> 
> //*summons @rnkovacs*//
> 
> Generally, i'd rather bail out on this branch. If we're seeing a dyn_cast of 
> something that //isn't a class//, we're already doing something wrong.
Well, at least it does not crash. Thanks! I like that general return which we 
could evolve further. It is the same story like `Assuming...`.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64374/new/

https://reviews.llvm.org/D64374



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to