This is an archive of the discontinued LLVM Phabricator instance.

Fix PR20444 -- wrong number of vftable slots created when return adjustment thunks are needed
ClosedPublic

Authored by timurrrr on Aug 7 2014, 6:11 AM.

Details

Reviewers
rnk

Diff Detail

Event Timeline

timurrrr updated this revision to Diff 12280.Aug 7 2014, 6:11 AM
timurrrr retitled this revision from to Fix PR20444 -- wrong number of vftable slots created when return adjustment thunks are needed.
timurrrr updated this object.
timurrrr edited the test plan for this revision. (Show Details)
timurrrr added a reviewer: rnk.
timurrrr added a subscriber: Unknown Object (MLST).
rnk accepted this revision.Aug 8 2014, 11:17 AM
rnk edited edge metadata.

lgtm

lib/AST/VTableBuilder.cpp
2795

So this fix (I think I wrote it?) was incorrect. We need to look back at the chain of method overrides in the current vftable, rather than all possible overrides.

2885–2886

I would say something like:

// Once a chain of method overrides adds a return adjusting vftable slot, all subsequent overrides will also use an extra method slot.

Would you agree with that statement?

This revision is now accepted and ready to land.Aug 8 2014, 11:17 AM
timurrrr added inline comments.Aug 8 2014, 12:03 PM
lib/AST/VTableBuilder.cpp
2795

Yep, you wrote it in r198080.
It was pretty much as incorrect as the earlier version that I've written :)
We just had insufficient test coverage to tell if we were right...

2885–2886

Yes, this statement seems to be correct. In my comment I wanted to emphasize that we have to do it even if this is suboptimal vftable-size-wise, but apparently made the main point a bit too complex.

Do you think I should just use your wording or merge the two?

timurrrr closed this revision.Aug 10 2014, 4:51 AM

OK, I've just used your wording for the comment in r215312.