Skip to content

Commit

Permalink
secure codegen by not returning a default value
Browse files Browse the repository at this point in the history
As title
  • Loading branch information
esc committed May 31, 2024
1 parent ab0b337 commit 57ca469
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions numba_rvsdg/core/datastructures/ast_transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,7 @@ def codegen_view() -> list[Any]:
]
elif type(block) is SyntheticTail:
# Synthetic tails do nothing.
pass
return []
elif type(block) is SyntheticFill:
# Synthetic fills must have a pass statement to main syntactical
# correctness of the final program.
Expand Down Expand Up @@ -861,7 +861,8 @@ def if_cascade(jump_targets: list[str]) -> list[ast.AST]:
return if_cascade(list(block.jump_targets[::-1]))
else:
raise NotImplementedError
return []

raise NotImplementedError("unreachable")


def AST2SCFG(code: str | list[ast.FunctionDef] | Callable[..., Any]) -> SCFG:
Expand Down

0 comments on commit 57ca469

Please sign in to comment.