(whoops, accidentally sent too early)
Generally, Call.getDecl() is nullable, we should always check it before use!
Differential D61285
[analyzer] SmartPtrModeling: Fix a null dereference. NoQ on Apr 29 2019, 4:53 PM. Authored by
Details (whoops, accidentally sent too early) Generally, Call.getDecl() is nullable, we should always check it before use!
Diff Detail
Event TimelineComment Actions LG! These mistakes are so easy to make. Maybe we should add nullability annotations (or use optionals) in the future? (Or just make every non-null pointer a reference and make it a convention to always check for nulls?) Comment Actions The whole AST consists in passing raw unannotated pointers around and i suspect it'll be annoying to deal with Stmt &s and Decl &s specifically in the Analyzer when all AST APIs accept pointers. I guess we'll have to go with some sort of nullability annotations, yeah. But first we need to fix Static Analyzer false positives on LLVM :) |