[PATCH] D149733: [clang][USR] Prevent crashes on incomplete FunctionDecls

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 3 03:32:03 PDT 2023


kadircet added a comment.

FWIW, https://github.com/llvm/llvm-project/blob/main/clang/lib/AST/Decl.cpp#L2987 is the assertion that suggests "null type is fine for functiondecls", but as pointed out pretty much all of the methods assume it's non-null && most of the users also don't check for validness before use.
so my 2cents, in the past this intermediate state of a functiondecl wasn't observable outside, but overtime that "constraint" got violated in various places.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D149733



More information about the cfe-commits mailing list