This is an archive of the discontinued LLVM Phabricator instance.

Add null check for promoted direct call
ClosedPublic

Authored by danielcdh on Aug 28 2017, 11:35 PM.

Details

Summary

We originally assume that in pgo-icp, the promoted direct call will never be null after strip point casts. However, stripPointerCasts is so smart that it could possibly return the value of the function call if it knows that the return value is always an argument. In this case, the returned value cannot cast to Instruction. In this patch, null check is added to ensure null pointer will not be accessed.

Event Timeline

danielcdh created this revision.Aug 28 2017, 11:35 PM
This revision is now accepted and ready to land.Aug 29 2017, 6:18 AM
danielcdh closed this revision.Aug 29 2017, 8:29 AM