This is an archive of the discontinued LLVM Phabricator instance.

[CodeGen] Prevent nullptr deref in genAlternativeCodeSequence
ClosedPublic

Authored by fdeazeve on Mar 8 2023, 10:07 AM.

Details

Summary

A pointer dereference was added (D141302) above an assert that checks
whether the pointer is null. This commit moves the assert above the
dereference and transforms it into an llvm_unreachable to better express
the intent that certain switch cases should never be reached.

Diff Detail

Event Timeline

fdeazeve created this revision.Mar 8 2023, 10:07 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 8 2023, 10:07 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
fdeazeve requested review of this revision.Mar 8 2023, 10:07 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 8 2023, 10:07 AM
fdeazeve updated this revision to Diff 503431.Mar 8 2023, 10:09 AM

Update commit message

fdeazeve edited the summary of this revision. (Show Details)Mar 8 2023, 10:10 AM
fdeazeve added a reviewer: fhahn.
fhahn accepted this revision.Mar 8 2023, 10:38 AM

LGTM, thanks!

This revision is now accepted and ready to land.Mar 8 2023, 10:38 AM
This revision was landed with ongoing or failed builds.Mar 8 2023, 10:41 AM
This revision was automatically updated to reflect the committed changes.