Revision 6e23543bc477eb46e5fc8d5cab119190b990ed7c authored by Keno Fischer on 24 November 2023, 15:26:51 UTC, committed by GitHub on 24 November 2023, 15:26:51 UTC
This is cherry-picked from #52245. This is an independent bugfix, and
looks like #52245 might need another round of discussion.

There were two separate off-by-1's in the codegen code that is trying to
detect assignments to slots inside try/catch regions.

First, it was asking to include the value of the catch label, which is
actually the first statement *not* in the try region. Second, there was
a confusion of 0 and 1 based indexing in the iteration bounds. The end
result of this was that the code was also looking at the first two
statements of the catch region.

This wasn't a problem before #52245 (other than a potentially
over-conservative marking of some slots as volatile), because our catch
blocks always had at least two statements (a :leave and a terminator),
but with the `:leave` change, it is possible to have catch blocks with
only one statement. If these happened to be at the end of the function,
things would blow up.

As a side node, this code isn't particularly sound, because it assumes
that try/catch regions are lexical, which they are not. The assumption
happens to work out ok for the code we generate in the frontend and
optimized IR doesn't have slots, so we don't use this code, but it is
not in general sound.
1 parent a386cd1
History
File Mode Size
RelocationTestPkg1
RelocationTestPkg2
TestPkg
clangsa
compiler
depot
embedding
gc
gcext
llvmpasses
manifest
netload
project
strings
testhelpers
unicode
.gitignore -rw-r--r-- 94 bytes
Makefile -rw-r--r-- 3.1 KB
abstractarray.jl -rw-r--r-- 73.2 KB
ambiguous.jl -rw-r--r-- 16.6 KB
arrayops.jl -rw-r--r-- 106.8 KB
asyncmap.jl -rw-r--r-- 2.4 KB
atexit.jl -rw-r--r-- 10.5 KB
atomics.jl -rw-r--r-- 22.9 KB
backtrace.jl -rw-r--r-- 9.1 KB
binaryplatforms.jl -rw-r--r-- 21.0 KB
bitarray.jl -rw-r--r-- 70.6 KB
bitset.jl -rw-r--r-- 10.7 KB
boundscheck.jl -rw-r--r-- 814 bytes
boundscheck_exec.jl -rw-r--r-- 7.2 KB
broadcast.jl -rw-r--r-- 42.7 KB
cartesian.jl -rw-r--r-- 19.5 KB
ccall.jl -rw-r--r-- 64.3 KB
channel_threadpool.jl -rw-r--r-- 613 bytes
channels.jl -rw-r--r-- 18.2 KB
char.jl -rw-r--r-- 11.2 KB
checked.jl -rw-r--r-- 16.9 KB
choosetests.jl -rw-r--r-- 9.9 KB
client.jl -rw-r--r-- 1.6 KB
cmdlineargs.jl -rw-r--r-- 43.6 KB
combinatorics.jl -rw-r--r-- 5.0 KB
complex.jl -rw-r--r-- 55.0 KB
copy.jl -rw-r--r-- 7.5 KB
core.jl -rw-r--r-- 209.4 KB
corelogging.jl -rw-r--r-- 15.3 KB
deprecation_exec.jl -rw-r--r-- 6.2 KB
dict.jl -rw-r--r-- 47.9 KB
docs.jl -rw-r--r-- 32.4 KB
download.jl -rw-r--r-- 262 bytes
download_exec.jl -rw-r--r-- 1.0 KB
enums.jl -rw-r--r-- 7.9 KB
env.jl -rw-r--r-- 5.0 KB
error.jl -rw-r--r-- 3.8 KB
errorshow.jl -rw-r--r-- 41.1 KB
euler.jl -rw-r--r-- 16.9 KB
exceptions.jl -rw-r--r-- 10.8 KB
fastmath.jl -rw-r--r-- 10.6 KB
file.jl -rw-r--r-- 61.2 KB
filesystem.jl -rw-r--r-- 1.2 KB
float16.jl -rw-r--r-- 7.5 KB
floatapprox.jl -rw-r--r-- 2.3 KB
floatfuncs.jl -rw-r--r-- 10.5 KB
functional.jl -rw-r--r-- 7.6 KB
gc.jl -rw-r--r-- 981 bytes
generic_map_tests.jl -rw-r--r-- 4.0 KB
gmp.jl -rw-r--r-- 23.5 KB
goto.jl -rw-r--r-- 3.1 KB
hashing.jl -rw-r--r-- 10.1 KB
int.jl -rw-r--r-- 15.5 KB
interpreter.jl -rw-r--r-- 919 bytes
intfuncs.jl -rw-r--r-- 23.1 KB
intrinsics.jl -rw-r--r-- 18.9 KB
iobuffer.jl -rw-r--r-- 10.4 KB
iostream.jl -rw-r--r-- 5.6 KB
iterators.jl -rw-r--r-- 35.1 KB
keywordargs.jl -rw-r--r-- 11.3 KB
llvmcall.jl -rw-r--r-- 8.8 KB
llvmcall2.jl -rw-r--r-- 3.7 KB
loading.jl -rw-r--r-- 47.9 KB
math.jl -rw-r--r-- 62.0 KB
meta.jl -rw-r--r-- 8.1 KB
misc.jl -rw-r--r-- 42.3 KB
missing.jl -rw-r--r-- 25.1 KB
mod2pi.jl -rw-r--r-- 12.8 KB
mpfr.jl -rw-r--r-- 35.9 KB
namedtuple.jl -rw-r--r-- 16.9 KB
numbers.jl -rw-r--r-- 117.5 KB
offsetarray.jl -rw-r--r-- 29.9 KB
opaque_closure.jl -rw-r--r-- 10.7 KB
operators.jl -rw-r--r-- 11.7 KB
ordering.jl -rw-r--r-- 2.4 KB
osutils.jl -rw-r--r-- 2.6 KB
parse.jl -rw-r--r-- 13.0 KB
path.jl -rw-r--r-- 17.4 KB
precompile.jl -rw-r--r-- 66.4 KB
print_process_affinity.jl -rw-r--r-- 896 bytes
profile_spawnmany_exec.jl -rw-r--r-- 300 bytes
ranges.jl -rw-r--r-- 98.3 KB
rational.jl -rw-r--r-- 31.8 KB
read.jl -rw-r--r-- 23.8 KB
reduce.jl -rw-r--r-- 26.3 KB
reducedim.jl -rw-r--r-- 31.0 KB
reflection.jl -rw-r--r-- 40.2 KB
regex.jl -rw-r--r-- 12.0 KB
reinterpretarray.jl -rw-r--r-- 23.7 KB
relocatedepot.jl -rw-r--r-- 5.1 KB
rounding.jl -rw-r--r-- 17.0 KB
runtests.jl -rw-r--r-- 17.8 KB
ryu.jl -rw-r--r-- 39.2 KB
scopedvalues.jl -rw-r--r-- 2.9 KB
secretbuffer.jl -rw-r--r-- 5.2 KB
sets.jl -rw-r--r-- 33.8 KB
show.jl -rw-r--r-- 99.3 KB
simdloop.jl -rw-r--r-- 4.5 KB
smallarrayshrink.jl -rw-r--r-- 626 bytes
some.jl -rw-r--r-- 4.3 KB
sorting.jl -rw-r--r-- 46.7 KB
spawn.jl -rw-r--r-- 35.5 KB
specificity.jl -rw-r--r-- 12.7 KB
stack_overflow.jl -rw-r--r-- 1.0 KB
stacktraces.jl -rw-r--r-- 9.5 KB
staged.jl -rw-r--r-- 10.1 KB
stress.jl -rw-r--r-- 2.6 KB
stress_fd_exec.jl -rw-r--r-- 675 bytes
subarray.jl -rw-r--r-- 26.6 KB
subtype.jl -rw-r--r-- 112.5 KB
syntax.jl -rw-r--r-- 108.6 KB
sysinfo.jl -rw-r--r-- 1.6 KB
terminfo.jl -rw-r--r-- 43.9 KB
test_exec.jl -rw-r--r-- 157 bytes
test_sourcepath.jl -rw-r--r-- 601 bytes
testdefs.jl -rw-r--r-- 4.4 KB
testenv.jl -rw-r--r-- 2.5 KB
threadpool_latency.jl -rw-r--r-- 1.2 KB
threadpool_use.jl -rw-r--r-- 755 bytes
threads.jl -rw-r--r-- 10.6 KB
threads_exec.jl -rw-r--r-- 32.7 KB
triplequote.jl -rw-r--r-- 1.3 KB
tuple.jl -rw-r--r-- 28.7 KB
vecelement.jl -rw-r--r-- 3.4 KB
version.jl -rw-r--r-- 8.9 KB
worlds.jl -rw-r--r-- 15.7 KB

back to top