aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Stellard <tstellar@redhat.com>2019-06-06 21:19:54 +0000
committerTom Stellard <tstellar@redhat.com>2019-06-06 21:19:54 +0000
commita7c78c204e77089a061125659d3f16b0a36c4ce2 (patch)
tree12ff9d29c9b4fb035283af79a512a39734d6aa3b
parent3b803b0120eddb9f096bd1c904a6e9e88af4ae55 (diff)
downloadtest-suite-release_80.tar.gz
Add missing changes from r362747release_80
git-svn-id: https://llvm.org/svn/llvm-project/test-suite/branches/release_80@362751 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--MultiSource/Applications/siod/slib.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/MultiSource/Applications/siod/slib.c b/MultiSource/Applications/siod/slib.c
index 39980432..f3b89b3e 100644
--- a/MultiSource/Applications/siod/slib.c
+++ b/MultiSource/Applications/siod/slib.c
@@ -129,7 +129,11 @@ long inums_dim = 256;
struct user_type_hooks *user_types = NULL;
long user_tc_next = tc_user_min;
struct gc_protected *protected_registers = NULL;
+#if defined(__GLIBC__)
+ucontext_t save_regs_gc_mark;
+#else
jmp_buf save_regs_gc_mark;
+#endif
double gc_rt;
long gc_cells_collected;
char *user_ch_readm = "";
@@ -1266,9 +1270,18 @@ void gc_mark_and_sweep(void)
{heap->type = tc_free_cell;
heap->gc_mark = 0;
++heap;}
+#if defined(__GLIBC__)
+ // With glibc, some register is mangled in jmp buffer, so object that
+ // is pointed by those register is collected as garbage. We use getcontext
+ // to avoid such issue.
+ getcontext(&save_regs_gc_mark);
+ mark_locations((LISP *) &save_regs_gc_mark.uc_mcontext,
+ (LISP *) (((char *) &save_regs_gc_mark.uc_mcontext) + sizeof(mcontext_t)));
+#else
setjmp(save_regs_gc_mark);
mark_locations((LISP *) save_regs_gc_mark,
(LISP *) (((char *) save_regs_gc_mark) + sizeof(save_regs_gc_mark)));
+#endif
mark_protected_registers();
mark_locations((LISP *) stack_start_ptr,
(LISP *) &stack_end);