This is an archive of the discontinued LLVM Phabricator instance.

[ubsan] Null-check and adjust TypeLoc before using it
ClosedPublic

Authored by vsk on Feb 10 2020, 1:38 PM.

Details

Summary

Null-check and adjut a TypeLoc before casting it to a FunctionTypeLoc.
This fixes a crash in -fsanitize=nullability-return, and also makes the
location of the nonnull type available when the return type is adjusted.

rdar://59263039

Diff Detail

Event Timeline

vsk created this revision.Feb 10 2020, 1:38 PM
vsk updated this revision to Diff 243672.Feb 10 2020, 2:04 PM
vsk retitled this revision from [ubsan] Null-check TypeLoc before using it to [ubsan] Null-check and adjust TypeLoc before using it.
vsk edited the summary of this revision. (Show Details)
  • Check adjusted return type per Erik's offline feedback.
This revision is now accepted and ready to land.Feb 10 2020, 2:06 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 10 2020, 2:15 PM