f432d1282d
PR go/72814 runtime: treat zero-sized result value as void Change the FFI interface to treat a call to a function that returns a zero-sized result as a call to a function that returns void. This is part of the fix for https://gcc.gnu.org/PR72814. On 32-bit SPARC systems, a call to a function that returns a non-zero-sized struct is followed by an unimp instruction that describes the size of the struct. The function returns to the address after the unimp instruction. The libffi library can not represent a zero-sized struct, so we wind up treating it as a 1-byte struct. Thus in that case libffi calls the function with an unimp instruction, but the function does not adjust the return address. The result is that the program attempts to execute the unimp instruction, causing a crash. This is part of a change that fixes the crash by treating all functions that return zero bytes as functions that return void. Reviewed-on: https://go-review.googlesource.com/25585 * go-gcc.cc (Gcc_backend::function_type): If the return type is zero bytes, treat the function as returning void. (return_statement): If the return type is zero bytes, don't actually return any values. From-SVN: r239252 |
||
---|---|---|
.. | ||
arch.h | ||
array.h | ||
chan.goc | ||
chan.h | ||
cpuprof.goc | ||
defs.h | ||
env_posix.c | ||
getncpu-bsd.c | ||
getncpu-irix.c | ||
getncpu-linux.c | ||
getncpu-none.c | ||
getncpu-solaris.c | ||
go-alloc.h | ||
go-append.c | ||
go-assert-interface.c | ||
go-assert.c | ||
go-assert.h | ||
go-breakpoint.c | ||
go-byte-array-to-string.c | ||
go-caller.c | ||
go-callers.c | ||
go-can-convert-interface.c | ||
go-cdiv.c | ||
go-cgo.c | ||
go-check-interface.c | ||
go-construct-map.c | ||
go-convert-interface.c | ||
go-copy.c | ||
go-defer.c | ||
go-defer.h | ||
go-deferred-recover.c | ||
go-eface-compare.c | ||
go-eface-val-compare.c | ||
go-ffi.c | ||
go-ffi.h | ||
go-fieldtrack.c | ||
go-iface.goc | ||
go-int-array-to-string.c | ||
go-int-to-string.c | ||
go-interface-compare.c | ||
go-interface-eface-compare.c | ||
go-interface-val-compare.c | ||
go-libmain.c | ||
go-main.c | ||
go-make-slice.c | ||
go-map-delete.c | ||
go-map-index.c | ||
go-map-len.c | ||
go-map-range.c | ||
go-matherr.c | ||
go-memcmp.c | ||
go-nanotime.c | ||
go-new-map.c | ||
go-new.c | ||
go-nosys.c | ||
go-now.c | ||
go-panic.c | ||
go-panic.h | ||
go-print.c | ||
go-recover.c | ||
go-reflect-call.c | ||
go-reflect-map.c | ||
go-rune.c | ||
go-runtime-error.c | ||
go-setenv.c | ||
go-signal.c | ||
go-strcmp.c | ||
go-string-to-byte-array.c | ||
go-string-to-int-array.c | ||
go-string.h | ||
go-strplus.c | ||
go-strslice.c | ||
go-traceback.c | ||
go-trampoline.c | ||
go-type-complex.c | ||
go-type-eface.c | ||
go-type-error.c | ||
go-type-float.c | ||
go-type-identity.c | ||
go-type-interface.c | ||
go-type-string.c | ||
go-type.h | ||
go-typedesc-equal.c | ||
go-unsafe-new.c | ||
go-unsafe-newarray.c | ||
go-unsafe-pointer.c | ||
go-unsetenv.c | ||
go-unwind.c | ||
go-varargs.c | ||
goc2c.c | ||
heapdump.c | ||
interface.h | ||
lfstack.goc | ||
lock_futex.c | ||
lock_sema.c | ||
malloc.goc | ||
malloc.h | ||
map.goc | ||
map.h | ||
mcache.c | ||
mcentral.c | ||
mem_posix_memalign.c | ||
mem.c | ||
mfixalloc.c | ||
mgc0.c | ||
mgc0.h | ||
mheap.c | ||
mprof.goc | ||
msize.c | ||
netpoll_epoll.c | ||
netpoll_kqueue.c | ||
netpoll_select.c | ||
netpoll_stub.c | ||
netpoll.goc | ||
panic.c | ||
parfor.c | ||
print.c | ||
proc.c | ||
rdebug.goc | ||
reflect.goc | ||
rtems-task-variable-add.c | ||
runtime1.goc | ||
runtime.c | ||
runtime.h | ||
sema.goc | ||
signal_unix.c | ||
signal_unix.h | ||
sigqueue.goc | ||
string.goc | ||
thread-linux.c | ||
thread-sema.c | ||
thread.c | ||
time.goc | ||
yield.c |