HomePhabricator

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

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

Description

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

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.

Differential Revision: https://reviews.llvm.org/D73280

Details