mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-10 14:00:21 +02:00
Fix argument passing in VM hooks.
* libguile/vm.c (vm_dispatch_hook): Take care of FRAME's alignment explicitly so that it's correct even if the current stack frame isn't 8-byte aligned (as can be the case on i686--the SysV i386 ABI just says that the stack is word-aligned.)
This commit is contained in:
parent
8684029d21
commit
8e4c60ff29
1 changed files with 9 additions and 4 deletions
|
@ -191,7 +191,7 @@ vm_dispatch_hook (SCM vm, int hook_num)
|
|||
struct scm_vm *vp;
|
||||
SCM hook;
|
||||
struct scm_frame c_frame;
|
||||
scm_t_aligned_cell frame;
|
||||
scm_t_cell *frame;
|
||||
SCM args[1];
|
||||
int saved_trace_level;
|
||||
|
||||
|
@ -218,9 +218,14 @@ vm_dispatch_hook (SCM vm, int hook_num)
|
|||
c_frame.sp = vp->sp;
|
||||
c_frame.ip = vp->ip;
|
||||
c_frame.offset = 0;
|
||||
frame.cell.word_0 = SCM_PACK (scm_tc7_frame);
|
||||
frame.cell.word_1 = PTR2SCM (&c_frame);
|
||||
args[0] = PTR2SCM (&frame);
|
||||
|
||||
/* Arrange for FRAME to be 8-byte aligned, like any other cell. */
|
||||
frame = alloca (sizeof (*frame) + 8);
|
||||
frame = (scm_t_cell *) ROUND_UP ((scm_t_uintptr) frame, 8UL);
|
||||
|
||||
frame->word_0 = SCM_PACK (scm_tc7_frame);
|
||||
frame->word_1 = PTR2SCM (&c_frame);
|
||||
args[0] = PTR2SCM (frame);
|
||||
|
||||
scm_c_run_hookn (hook, args, 1);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue