Skip to content
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

10078-To-check-CompiledMethodlocalReadsSelf-does-isFFIMethod-check #10086

Conversation

MarcusDenker
Copy link
Member

This PR fixes #10078:

  • Move the FFI check from #localReadSelf to #usingMethods of SelfVariable
  • add a test and comment to testReadsSelf. I do not execute an FFI method here to not add a dependency / make this test platform specific
  • add tests for #usingMethods for self:
    • check that we can find the test method itself (with the self assert)
    • check that if we use super, we do not find it
    • add test to check for a #isFFIMethod that does not read self, but we find it still by #usingMethods of SelfVariable

- Move the FFI check from #localReadSelf to #usingMethods of SelfVariable
- add a test and comment to  testReadsSelf. I do not execute an FFI method here to not add a dependency / make this test platform specific
- add tests for #usingMethods for self:
	- check that we can find the test method itself (with the self assert)
	- check that if we use super, we do not find it
	- add test to check for a #isFFIMethod that does not read self, but we find it still by #usingMethods of SelfVariable
@MarcusDenker
Copy link
Member Author

@tesonep tesonep merged commit 48d4f64 into pharo-project:Pharo10 Oct 7, 2021

^ environment allMethods select: [ :method |
method isFFIMethod or: [
method readsSelf and: [
method sendsToSuper not or: [
method ast variableNodes anySatisfy: [ :varNode |
Copy link
Contributor

Choose a reason for hiding this comment

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

Some useful method can be extracted here:

method ast includesVariable: self

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

Successfully merging this pull request may close these issues.

To check: CompiledMethod>>#localReadsSelf does isFFIMethod check
3 participants