summaryrefslogtreecommitdiff
path: root/libguile/vm-i-loader.c
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2012-01-27 19:04:46 +0100
committerAndy Wingo <wingo@pobox.com>2012-01-27 19:34:19 +0100
commit04b2d773548c57b6eadd1808a8d15cce47af9630 (patch)
tree18fa47ca6a85f444788c286323a4c523be0f634e /libguile/vm-i-loader.c
parentc0e4449908eee84bcb293ec21c10fec646bde45d (diff)
downloadguile-04b2d773548c57b6eadd1808a8d15cce47af9630.tar.gz
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.
Diffstat (limited to 'libguile/vm-i-loader.c')
-rw-r--r--libguile/vm-i-loader.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/libguile/vm-i-loader.c b/libguile/vm-i-loader.c
index 6fa8eb2ea..19f527135 100644
--- a/libguile/vm-i-loader.c
+++ b/libguile/vm-i-loader.c
@@ -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;
}