Java 12: javac crash with switch expression containing try-catch-finally
Jan Lahoda
jan.lahoda at oracle.com
Mon Mar 25 18:33:28 UTC 2019
On 25.3.2019 15:59, B. Blaser wrote:
> Hi Jan,
>
> On Mon, 25 Mar 2019 at 14:27, Jan Lahoda <jan.lahoda at oracle.com> wrote:
>>
>> Hi Bernard,
>>
>> My current thinking is that we will need to restore the stack right
>> before the final goto for the given break (which can be skipped if
>> code.isAlive() == false).
>>
>> I've put my current patch here (incl. test) (I wasn't running other
>> tests on this patch yet, though):
>> http://cr.openjdk.java.net/~jlahoda/8220018/8220018
>>
>> This does not cover the switch expressions over booleans yet, that is
>> something I am looking at right now.
>>
>> Jan
>
> I was working on a similar solution as I found that my previous patch
> wasn't working with 'try' within 'finally'. The solution, very close
> to yours, was also handling conditional expressions which currently
> doesn't seem to execute the 'finally' clause.
> However, I still have a couple of failing tests... does your solution
> pass all langtools:tier1?
> Please, share it when covering conditional expressions too.
I've updated the patch with a version that strives to handle the boolean
switch expressions. Passes all tests except
tools/javac/switchexpr/CRT.java, which depends on the exact structure of
the generated code. Among other things, I'd like to see if we could
generate the current bytecode when there is no try-finally, which should
help with the CRT.java test. More testing still needed, though.
Jan
>
> Bernard
>
More information about the compiler-dev
mailing list