Skip to content

Handle indirect calls in CallGraphPropertyAnalysis #2624

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 24, 2020
Merged

Handle indirect calls in CallGraphPropertyAnalysis #2624

merged 3 commits into from
Jan 24, 2020

Conversation

kripken
Copy link
Member

@kripken kripken commented Jan 24, 2020

We ignored them, which is a bad default, as typically they imply
we can call anything in the table (and the table might change).
Instead, notice indirect calls during traversal, and force the user
to decide whether to ignore them or not.

This was only an issue in PostEmscripten because the other
user, Asyncify, already had indirect call analysis because it
needed it for other things.

Fixes a bug uncovered by #2619 and fixes the current binaryen
roll.

@kripken kripken requested a review from tlively January 24, 2020 18:17
Copy link
Member

@tlively tlively left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@@ -549,7 +549,8 @@ class ModuleAnalyzer {
return !info.isBottomMostRuntime &&
!info.inBlacklist;
},
[](Info& info) { info.canChangeState = true; });
[](Info& info) { info.canChangeState = true; },
scanner.IgnoreIndirectCalls);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems strange to use scanner in the path to IgnoreIndirectCalls, but I guess the enclosing type is a pain to type out, so this is fine.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this seemed shorter, but I'm not totally happy with it either. Another option might be get_type_or_whatsitcalled(scanner)::IgnoreIndirectCalls?

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.

2 participants