From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 54407 invoked by alias); 16 Apr 2015 03:22:04 -0000 Mailing-List: contact libffi-discuss-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libffi-discuss-owner@sourceware.org Received: (qmail 54338 invoked by uid 89); 16 Apr 2015 03:21:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: plane.gmane.org Received: from plane.gmane.org (HELO plane.gmane.org) (80.91.229.3) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Thu, 16 Apr 2015 03:21:55 +0000 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1YiaND-0005nx-Uy for libffi-discuss@sourceware.org; Thu, 16 Apr 2015 05:21:52 +0200 Received: from 173-19-202-206.client.mchsi.com ([173.19.202.206]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 16 Apr 2015 05:21:51 +0200 Received: from wb8tyw by 173-19-202-206.client.mchsi.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 16 Apr 2015 05:21:51 +0200 To: libffi-discuss@sourceware.org From: "John E. Malmberg" Subject: src/alpha/ffitarget.h - FFI_TRAMPOLINE_SIZE Date: Thu, 16 Apr 2015 03:22:00 -0000 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 X-IsSubscribed: yes X-SW-Source: 2015/txt/msg00051.txt.bz2 I do not have a Tru64 system to test this on. Looking at the code in src/alpha/ffitarget.h and src/alpha/ffi.c, something does not look right. FFI_TRAMPOLINE_SIZE is set to 24 in ffitarget.h The typedef struct ffi_closure is then set up in ffi.h as: typedef struct { char tramp{FFI_TRAMPOLINE_SIZE]; ffi_cif * cif; void (*fun)... void *user_data } ffi_closure In ffi.c ffi_prep_closure_loc(), the code then does: tramp = (unsigned int *) &closure->tramp[0]; .... *(void **) &tramp[4] = ffi_closure_osf; But tramp only has 3 longword members per the previous declaration, so &tramp[4] is the address of the '*cif' member of the structure which is then updated: closure->cif = cif; Am I understanding this correctly? Regards, -John