Skip to content

Exception edges should not count when determining exit nodes #177

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 4, 2025

Conversation

tmr232
Copy link
Owner

@tmr232 tmr232 commented May 4, 2025

Changes the criteria for exit nodes to either
have outdegree==0, or only have exception edges.

Closes #175.

Type of changes

  • Bug fix
  • New feature
  • Documentation / docstrings
  • Tests
  • Other

Checklist

  • I've run the bun lint on the code.
  • I've updated CHANGELOG.md and CONTRIBUTORS.md where appropriate.
  • I've added tests for new code.
  • For visual changes, I've added screenshots to the PR.
  • I accept that @tmr232 may be pedantic in the code review.

Description

Exit nodes are now rendered correctly inside try blocks.

Example for the following code:

def lookup_type(name):
	try:
		return gdb.lookup_type(name)
	except gdb.error:
		pass
	try:
		return gdb.lookup_type('struct ' + name)
	except gdb.error:
		pass
	try:
		return gdb.lookup_type('struct ' + name[1:]).pointer()
	except gdb.error:
		pass
Before After
image image

Changes the criteria for exit nodes to either
have outdegree==0, or only have exception edges.

Closes #175.
@tmr232 tmr232 force-pushed the return-from-try branch from e3b60ac to c2da2f0 Compare May 4, 2025 19:16
@tmr232 tmr232 merged commit e4d896c into main May 4, 2025
10 checks passed
@tmr232 tmr232 deleted the return-from-try branch May 4, 2025 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Python: Return in try is confusing
1 participant