This is an archive of the discontinued LLVM Phabricator instance.

[Evaluator] Bitcast result of pointer stripping
ClosedPublic

Authored by aeubanks on Apr 21 2021, 9:46 AM.

Details

Summary

Trying to evaluate a GEP would assert with

"Ty == cast<PointerType>(C->getType()->getScalarType())->getElementType()"

because the type of the pointer we would evaluate the GEP argument to
would be a different type than the GEP was expecting. We should treat
pointer stripping as a bitcast.

The test adds a redundant GEP that would crash due to type mismatch.

Diff Detail

Event Timeline

aeubanks created this revision.Apr 21 2021, 9:46 AM
aeubanks requested review of this revision.Apr 21 2021, 9:46 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 21 2021, 9:46 AM
rnk accepted this revision.Apr 21 2021, 1:17 PM

lgtm

This revision is now accepted and ready to land.Apr 21 2021, 1:17 PM
This revision was automatically updated to reflect the committed changes.