Account for exact references in indirect call effects#8807
Account for exact references in indirect call effects#8807stevenfontanella wants to merge 1 commit into
Conversation
tlively
left a comment
There was a problem hiding this comment.
Something I realized we're probably not handling correctly (but tell me if I'm wrong) is inexact function imports. When I import a function inexactly with type $super, take a reference to it somewhere, and then somewhere else do an indirect call to $sub, it's possible that I end up calling the import. That's because the reference to the imported function reference can be cast to $sub, and that cast might succeed depending on the function that was supplied at instantiation time.
But this is probably a pre-existing bug. I only thought about it because I was considering exactness. It probably makes sense to fix separately.
| self->getModule()->indirectCallEffects, callIndirect->heapType); | ||
| if (auto* effects = | ||
| find_or_null(self->getModule()->indirectCallEffects, | ||
| std::make_pair(callIndirect->heapType, Inexact)); |
There was a problem hiding this comment.
Is there a reason it's std::make_pair here but std::pair above? Does using an initializer list not work because the templates need to have more type information? Generally I prefer just using the initializer list where possible.
| auto newType = updater.getNew(oldType); | ||
| std::shared_ptr<const EffectAnalyzer>& targetEffects = | ||
| newTypeEffects[newType]; | ||
| newTypeEffects[std::pair(newType, exactness)]; |
There was a problem hiding this comment.
| newTypeEffects[std::pair(newType, exactness)]; | |
| newTypeEffects[{newType, exactness}]; |
Part of #8615. Allows us to ignore effects from func subtypes when we have an indirect call to an exact reference.