Skip to content

Commit

Permalink
Exclude subObjects from id2block_list dict generation
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcere committed Jan 10, 2025
1 parent a5b86d3 commit 00f93b3
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/parser/cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def get_as_json(self):

def generate_id2block_list(self) -> Dict[component_name_T, CFGBlockList]:
"""
Returns the list of all blocks inside the same object, function and subobjects
Returns the list of all blocks inside the same object, function (excluding subObjects)
"""
name2block_list = dict()
for object_id, cfg_object in self.objectCFG.items():
Expand All @@ -77,11 +77,6 @@ def generate_id2block_list(self) -> Dict[component_name_T, CFGBlockList]:
for function_name, cfg_function in cfg_object.functions.items():
name2block_list[function_name] = cfg_function.blocks

subobject = self.get_subobject()

if subobject is not None:
name2block_list.update(subobject.generate_id2block_list())

return name2block_list

def modify_cfg_block_list(self, f: Callable[[CFGBlockList], CFGBlockList]) -> None:
Expand Down

0 comments on commit 00f93b3

Please sign in to comment.