Skip to content

Conversation

@bdash
Copy link
Contributor

@bdash bdash commented Dec 2, 2025

This support in LowLevelILInstruction::CopyTo will be used in the future to provide the option for automatic inlining during analysis to create the inlined instructions with the address of the call instruction, rather than the address of the instruction in the original function.

The MediumLevelILInstruction and HighLevelILInstruction versions are updated for consistency, with no specific use case in mind.

@plafosse
Copy link
Member

plafosse commented Dec 2, 2025

Did you discuss this with @D0ntPanic? I know when he originally implemented it he discarded the idea of using the call site address because of unforeseen side effects that I don't remember.

@rssor
Copy link
Member

rssor commented Dec 2, 2025

It's definitely not the general purpose solution for inlining in general, but it's needed for a very particular case where the side effect is absolutely intended.

@rssor
Copy link
Member

rssor commented Dec 2, 2025

The only alternative would be an enormous, and expensive lift, where places we key markup on ArchAndAddr would have to all be moved to basically vector<ArchAndAddr> to allow references to program locations as essentially a path through a tree, with nodes being the actual terminal location or the point at which inlining occurred, which at an API level would be almost unusable and in the core would be quite expensive because map<ArchAndAddr, X> is used all over the place.

@bdash
Copy link
Contributor Author

bdash commented Dec 2, 2025

As Ryan mentions, this is intended to be used as part of a minimally invasive approach to fixing #6737 by changing the addresses of instructions inlined from stub functions only. The default behavior when inlining instructions will still be to use the instruction's original address.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants