[arm] Fix fetching of method addresses (#17099)
commit8c1ef74bb125bf49d6b1e3f2e80ac235adb27bd8
authorVlad Brezae <brezaevlad@gmail.com>
Thu, 3 Oct 2019 19:29:55 +0000 (3 22:29 +0300)
committerGitHub <noreply@github.com>
Thu, 3 Oct 2019 19:29:55 +0000 (3 22:29 +0300)
treec1bb09240ce8863e932610c98900777188596b08
parentea9dad72492a1031451324a99513c8e7ff565c16
[arm] Fix fetching of method addresses (#17099)

After https://github.com/mono/mono/commit/9ff3b0d65ee4, in an aot image we can emit addresses either as bl offset (which uses 4 bytes) or as ldr pc, =<label>; <addr> (which uses 8 bytes). Before this commit we were dereferencing an instruction pointer, in get_call_table_entry, assuming 8 bytes per entry. This could overflow and crash if we used in fact only 4 bytes per entry. Fix this by including the entry size in the aot image.

Fixes random crashes on arm CI on full-aotmixed suite.
mono/mini/aot-compiler.c
mono/mini/aot-runtime.c
mono/mini/aot-runtime.h
mono/mini/mini-llvm.c