1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-14 15:40:19 +02:00

attempt to clear stale references on VM C stack

* libguile/vm-engine.h (DEAD): New macro, nulls out a value.

* libguile/vm-i-system.c:
* libguile/vm-i-loader.c:
* libguile/vm-i-scheme.c: Use DEAD when variables become dead.

Later we can #ifdef this out, but I want to give the buildbots a try
with this patch to make sure it's correct.
This commit is contained in:
Andy Wingo 2012-01-27 19:04:46 +01:00
parent c0e4449908
commit 04b2d77354
4 changed files with 229 additions and 10 deletions

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2001,2008,2009,2010,2011 Free Software Foundation, Inc.
/* Copyright (C) 2001,2008,2009,2010,2011,2012 Free Software Foundation, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
@ -73,6 +73,9 @@ VM_DEFINE_LOADER (104, load_program, "load-program")
PUSH (scm_make_program (objcode, objs, SCM_BOOL_F));
DEAD (objs);
DEAD (objcode);
ip += len;
NEXT;
@ -84,6 +87,7 @@ VM_DEFINE_INSTRUCTION (105, link_now, "link-now", 0, 1, 1)
POP (what);
SYNC_REGISTER ();
PUSH (resolve_variable (what, scm_current_module ()));
DEAD (what);
NEXT;
}
@ -95,6 +99,8 @@ VM_DEFINE_LOADER (106, load_array, "load-array")
POP2 (shape, type);
SYNC_REGISTER ();
PUSH (scm_from_contiguous_typed_array (type, shape, ip, len));
DEAD (type);
DEAD (shape);
ip += len;
NEXT;
}