Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/dylin/analyses/InPlaceSortAnalysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def pre_call(self, dyn_ast: str, iid: int, function: Callable, pos_args, kw_args
# print(f"{self.analysis_name} pre_call {iid}")
if function is sorted:
# we have to keep the list in memory to keep id(pos_args[0]) stable ? nope!
if hasattr(pos_args[0], "__len__") and len(pos_args[0]) > self.threshold:
if type(pos_args[0]) is list and len(pos_args[0]) > self.threshold:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
if type(pos_args[0]) is list and len(pos_args[0]) > self.threshold:
if hasattr(pos_args[0], "sort") and hasattr(pos_args[0], "__len__") and len(pos_args[0]) > self.threshold:

self.stored_lists[id(pos_args[0])] = {
"iid": iid,
"file_name": dyn_ast,
Expand Down