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

SecureASTCustomizer can't see types set prior by a type-checking extension #1913

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

inad9300
Copy link

This is an incorrect, incomplete proposal to suggest that methods such as SecureASTCustomizer.SecuringCodeVisitor.visitMethodCallExpression() should probably be using TypeCheckingExtension.getType() as opposed to Expression.getType().

This is because, as suggested in the docs, type-checking extensions (via ASTTransformationCustomizer with CompileStatic) may be calling TypeCheckingExtension.storeType() to dynamically assign a type to a variable, but SecureASTCustomizer won't see that type even if run after such type-checking extension.

@eric-milles
Copy link
Member

The SecureASTCustomizer is run as part of the canonicalization compilation phase (5). Static type checking is run as part of the instruction selection phase (6).

But to your point, the types you can get from the AST directly are not what STC works out. The class generator uses TypeChooser interface to read static types.

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