Skip to content

Implement exception handling in java-slang#96

Draft
kjw142857 wants to merge 4 commits into
mainfrom
exception-handling
Draft

Implement exception handling in java-slang#96
kjw142857 wants to merge 4 commits into
mainfrom
exception-handling

Conversation

@kjw142857

@kjw142857 kjw142857 commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Implement exception handling for the following components (in progress):

  • JVM
  • Compiler
  • Type Checker
  • Parser

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces support for compiling try-catch-finally statements, refactors the JVM's ExceptionTable to be iterable and use a dedicated class structure, and adds unit tests for exception routing. It also fixes a buffer offset calculation bug in the disassembler when reading code attributes. The reviewer identified several critical bugs in the TryStatement code generation implementation—including a pass-by-value bug with unresolved label offsets, an early return bug when catches are absent but a finally block is present, and incorrect execution paths for finally blocks—and provided a comprehensive rewrite to address these issues.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/compiler/code-generator.ts
@github-actions

github-actions Bot commented Jun 16, 2026

Copy link
Copy Markdown

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements
71.72% (-0.55% 🔻)
7415/10339
🔴 Branches
58.68% (-0.44% 🔻)
2481/4228
🟡 Functions
68.68% (-0.36% 🔻)
1322/1925
🟡 Lines
72.54% (-0.59% 🔻)
6981/9624
Show new covered files 🐣
St.
File Statements Branches Functions Lines
🔴
... / exception-table.ts
23.08% 20% 28.57% 25%
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🟡
... / code-generator.ts
60.77% (-4.9% 🔻)
56.14% (-4.24% 🔻)
60.92% (-4.51% 🔻)
61.36% (-5.11% 🔻)

Test suite run success

1135 tests passing in 64 suites.

Report generated by 🧪jest coverage report action from b7a4b18

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.

2 participants