From 424109a452b824745604f041c818314e9aa748da Mon Sep 17 00:00:00 2001 From: steven-jenkins Date: Tue, 12 Feb 2002 13:38:20 +0000 Subject: [PATCH] GC_PROTECT'ed the necessary variables (specifically, where >1 arg to a function 'may GC') --- scsh/bsd/time_dep1.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/scsh/bsd/time_dep1.c b/scsh/bsd/time_dep1.c index 77fbbfc..0b52fdb 100644 --- a/scsh/bsd/time_dep1.c +++ b/scsh/bsd/time_dep1.c @@ -16,9 +16,23 @@ s48_value time_plus_ticks() { struct timeval t; struct timezone tz; - + s48_value sch_tv_sec = S48_UNSPECIFIC; + s48_value sch_tv_usec = S48_UNSPECIFIC; + s48_value sch_listval = S48_UNSPECIFIC; + s48_value sch_retval + S48_DECLARE_GC_PROTECT(3); + if( gettimeofday(&t, &tz) ) s48_raise_os_error (errno); - return s48_cons (s48_enter_integer (t.tv_sec), - s48_cons (s48_enter_integer (t.tv_usec), S48_NULL)); + S48_GC_PROTECT_3(sch_tv_sec, sch_tv_usec, sch_listval); + + sch_tv_sec = s48_enter_integer(t.tv_sec); + sch_tv_usec = s48_enter_integer(t.tv_usec); + sch_listval = s48_cons (sch_tv_usec, S48_NULL); + sch_retval = s48_cons (sch_tv_sec, sch_listval); + + S48_GC_UNPROTECT; + + return sch_retval; + }