Skip to content

Anonymous classes mutating parameters from outer method cause NullPointerException during Interprocedural analysis #30

@OscarRodriguezPrieto

Description

@OscarRodriguezPrieto

The method has no parameters.
The method makes a call with an outer parameter from a method outside the anonymous class.
After getting declarations from expressions, paramsToPDGRelations in MethodInfo class is empty.
Before Interprocedural analysis the info of the method (paramsToPDGRelations in MethodInfo class) is empty.
After Interprocedural analysis, the info of the method an outsider parameter is added to its info.
Since the parameter (with index 1 in its method) does not belong to the method being analyzed and this method has no parameters, when PQ tries to get info for this param index from invocationsMayModifyVars, we get a NullPointerException.
We plan to control not to add any outsider parameter to the paramsToPDGRelations info of the method to prevent this NullPointer but...
When the call over the parameter is added to the invocationsMayModifyVars?
Can we prevent adding such calls over outsider parameters...? NO! we need that info to complete the PDG

example:
https://github.com/classgraph/classgraph.git

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions