Skip to content

Python ModRef analysis says that a constant is modified #103

Closed
@khatchad

Description

@khatchad

Consider the following code:

def g(p1, p2):
    assert p1 == 5 and p2 == 2


def f():
    g(5, p2=2)


f()

The ModRef analysis for Python (com.ibm.wala.cast.python.modref.PythonModRef) is returning that the following locations are "modified" by f():

[[ConstantKey:p2:<PythonLoader,Lstring>]; [Core[Root]]]
[[ConstantKey:p2:<PythonLoader,Lstring>],<field 0>]

But, according to the docs, a ConstantKey is "an instance key which represents a unique, constant object." It would thus seem that instances represented by ConstantKey instance keys can't be returned as modified by the ModRef analysis.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions