[PATCH] D146466: [clang] diagnose function fallthrough
David Blaikie via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Mar 23 14:43:03 PDT 2023
dblaikie added a comment.
(recoverable feels like a bit of a distraction here? recoverable just means you've asked ubsan not to trap/stop on failure - but to let the program continue and do whatever it would've done without the sanitizer enabled - sometimes that's crash/trap anyway, sometimes it's something less bad... but that's all that's being asked for: "keep going/do whatever you'd do without the sanitizer enabled, rather than hard stop as soon as the sanitizer detects a problem" - no, we shouldn't recover differently/more safely with sanitizers enabled (don't want to create a language variant/encourage people to build incorrect programs with sanitizers and run them that way because "it works"))
but we could/should trap at the end of a function that lacks a valid return, if the end is reachable by local reasoning (ie: maybe we still trap after noreturn - alternatively we could guarantee to include a trap at the end of a noreturn so it can't return instead of trapping after noreturn? (wouldn't be 100% rigorous, because you could be mix-and-matching compilers, but might be the right tradeoff in terms of size/safety))
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D146466/new/
https://reviews.llvm.org/D146466
More information about the cfe-commits
mailing list