libphobos: Fix SIGBUS in read_encoded_value_with_base on sparc-sun-solaris (PR98584)
commit30b11d8d1be9c683f1517472c47a3cb69df02c4f
authorIain Buclaw <ibuclaw@gdcproject.org>
Tue, 20 Apr 2021 00:09:51 +0000 (20 02:09 +0200)
committerIain Buclaw <ibuclaw@gdcproject.org>
Tue, 20 Apr 2021 00:28:12 +0000 (20 02:28 +0200)
treea81c8b8f62284a5e719aced71b91c904714054fd
parent6e81e015d91568fc3df3939623ae999e0681a0fc
libphobos: Fix SIGBUS in read_encoded_value_with_base on sparc-sun-solaris (PR98584)

Instead of unsafe pointer dereferencing, use memcpy() to read encoded
values from memory.  The function `read_encoded_value' has been updated
to accept a ref parameter, this simplifies handling of the pointer to
memory needing to be read.

libphobos/ChangeLog:

PR d/98584
* libdruntime/gcc/deh.d (scanLSDA): Update calls to read_uleb128 and
read_encoded_value.
(actionTableLookup): Update calls to read_sleb128 and
read_encoded_value_with_base.
* libdruntime/gcc/unwind/pe.d (read_uleb128): Update signature.
(read_sleb128): Update signature.
(read_unaligned): New function.
(read_encoded_value_with_base): Update signature.  Call read_unaligned
instead of unsafe pointer dereferencing.
(read_encoded_value): Update signature.
libphobos/libdruntime/gcc/deh.d
libphobos/libdruntime/gcc/unwind/pe.d