On Fri, 8 May 2026 09:09:19 GMT, Paul Hübner <[email protected]> wrote:

> The implementation looks good, thank you! I feel like it would be very 
> valuable to introduce a regression test for this. Is that something that 
> could be feasible?

We can add one but I don't think it will be that useful. All we can really do 
is to check that these known runtime upcall places do things correctly. 

I think there is a mainline RFE here which refactors the `JavaCalls::call` 
style helpers and wrapper to return a type of `ReturnJavaValue`, which captures 
if an exception is pending (directly) after the call returned.

So we will do:
1. Check that there is no pending exception before the upcall
2. Store the pending exception state in the `ReturnJavaValue` type
3. Assert if one tries to get the result out of a `ReturnJavaValue` which was 
created from a call with a pending exception.

This would make us catch this and any future similar mistakes. But would 
require a bit of code churn / refactoring.

-------------

PR Comment: https://git.openjdk.org/valhalla/pull/2410#issuecomment-4406112970

Reply via email to