[clang][analyzer][NFC] Replace dyn_cast with cast in MemRegion::getMemorySpace
MemRegion::getMemorySpace() is annotated with LLVM_ATTRIBUTE_RETURNS_NONNULL (which triggers instant UB if a null pointer is returned), and callers indeed don't check the return value for null. Thus, even though llvm::dyn_cast is called, it can never return null in this context. Therefore, we can safely call llvm::cast. Reviewed By: steakhal Differential Revision: https://reviews.llvm.org/D151727
parent
0989ce94
Please register or sign in to comment