On Sun, Feb 14, 2021 at 04:34:20PM +0100, Bram Moolenaar wrote:
> This is where it runs into the problem: the size should be zero.
> Since it's OK when the later statements are changed, I suspect that the
> "isn_arg.number" value is overwritten when generating one of the later
> statements. Since this is the first instruction I guess some index is
> zero when filling in a jump position later. Perhaps it only fails on
> s390 because it lays out the union of the struct differently.
s390 is big-endian. On little-endian systems, there was still a
problem. For the endtry that was supposed to be skipped, we're
modifying the previous instruction (newlist). It just happens to cause
a different, undetected failure.
Here's the disassembled code for little-endian:
Test_try_catch_throw
var l = []
0 NEWLIST size 34359738368
1 STORE $0
try
2 TRY catch -> 7, finally -> 3
finally
add(l, 0)
3 LOAD $0
4 PUSHNR 0
5 LISTAPPEND
6 DROP
endtry
7 ENDTRY
if 1
else
try
endtry
endif
8 RETURN 0
> There is one such place added in 8.2.2506, I think it should check for
> the "skip" value. Let me give that a try.
> If that fixes it I do wonder why it doesn't fail on other systems.
> Perhaps because of how the union is laid out (overlapping different
> bytes).
I was about to send a similar patch. That does fix the problem.
Cheers,