Skip to content

Conversation

@jianlingzhong
Copy link
Contributor

@jianlingzhong jianlingzhong commented Dec 5, 2025

ignore this pull request. i'm just using this one to test CI.

jeaye added 30 commits October 16, 2025 12:55
This currently doesn't work with ASan, but I have an open issue for this
here: bdwgc/bdwgc#772
It leaks, leads to premature GC, takes too long to compile, and doesn't
support runtime sorting functions. We'll need a new solution.

For now, we're deep copying standard containers, which isn't going to
last us very long.
This addresses a GC crash we were seeing, as documented here: bdwgc/bdwgc#800 (comment)
jeaye and others added 30 commits December 1, 2025 08:12
This change updates the try special form to support multiple, typed catch clauses, enabling more granular exception handling and C++ interop.

Key changes:

Syntax: catch clauses now require an explicit type argument (e.g., (catch cpp/jank.runtime.object_ref e ...)).
Parser: Updated parse_try to handle multiple catch clauses with their corresponding types.
Codegen: Extended LLVM IR generation to support multiple catch blocks.
Tests: Updated existing tests to use the new explicit catch syntax and added new tests for multiple catches, nested try-catch-finally blocks, etc..
**Object Slicing Prevention (lines 2766-2783)**
- Added automatic promotion of C++ class/struct catch types to lvalue references
- Prevents object slicing when catching derived classes by base type
- Preserves polymorphic behavior (virtual methods work correctly)
- Exception: jank::runtime types (like object_ref) remain by-value (needs to figure out why)

**Duplicate Catch Detection (lines 2785-2796)**
- Added compile-time validation to detect duplicate catch clauses

**Fixed Pointer Exception Handling (lines 1797-1826)**
- Corrected exception value extraction for pointer types
- Pointer exceptions: Use caught_ptr directly (it IS the pointer value)
- Non-pointer exceptions: Dereference caught_ptr to get the value
- Fixes crashes when catching void*, int*, and other pointer types
- Added support for reference types and class/struct types

**Enhanced Load Detection (line 543)**
- Extended auto-load logic to handle pointer and reference types
- Ensures proper value extraction from alloca instructions
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.

8 participants