This is an archive of the discontinued LLVM Phabricator instance.

[LoopUnroll] Avoid UB when converting from WeakVH to `Value *`
ClosedPublic

Authored by bogner on Jan 23 2020, 10:30 AM.

Details

Summary

Calling operator* on a WeakVH with a null value yields a null
reference, which is UB. Avoid this by implicitly converting the WeakVH
to a Value * rather than dereferencing and then taking the address
for the type conversion.

Diff Detail

Event Timeline

bogner created this revision.Jan 23 2020, 10:30 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 23 2020, 10:30 AM
qcolombet accepted this revision.Jan 23 2020, 10:35 AM
This revision is now accepted and ready to land.Jan 23 2020, 10:35 AM
This revision was automatically updated to reflect the committed changes.