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

Can new arrays be allcoated on stack? #5

Open
42niks opened this issue Sep 28, 2020 · 2 comments
Open

Can new arrays be allcoated on stack? #5

42niks opened this issue Sep 28, 2020 · 2 comments

Comments

@42niks
Copy link
Member

42niks commented Sep 28, 2020

Should new array statements be tracked for their escape status or shall we just discard them as objects that escape?

@42niks
Copy link
Member Author

42niks commented Sep 29, 2020

getSootClass is not available for the object received from doing ((JNewArrayExpr)rhs).getBaseType(). Cannot check if it is runnable. @manasthakur

@manasthakur
Copy link
Member

If an array object does not escape the current method, my guess is that we can allocate it on the stack -- the array object is just a single reference and destroying it doesn't remove the contained objects (if they escape, they will still be accessible from the reference that made them escape).

For the second question, will the following work?

if (t instanceof RefType) {
    SootClass c = ((RefType) t).getSootClass();

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

No branches or pull requests

2 participants