From 2ab46f753dd775047aee2a3cdcecd92dad34f6d2 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Tue, 16 Aug 2011 13:30:51 +0000 Subject: [PATCH] recover slots --- C/iopreds.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/C/iopreds.c b/C/iopreds.c index 9f2c17bf6..c49325074 100644 --- a/C/iopreds.c +++ b/C/iopreds.c @@ -754,8 +754,10 @@ p_read2 ( USES_REGS1 ) Int out; if (!Yap_getInputStream(Yap_InitSlot(Deref(ARG8) PASS_REGS), &inp_stream)) { + Yap_RecoverSlots(1 PASS_REGS); return(FALSE); } + Yap_RecoverSlots(1 PASS_REGS); out = do_read(inp_stream, 8 PASS_REGS); return out; } @@ -1094,8 +1096,10 @@ p_encoding ( USES_REGS1 ) IOSTREAM *st; Term t = Deref(ARG2); if (!PL_get_stream_handle(Yap_InitSlot(Deref(ARG1) PASS_REGS), &st)) { + Yap_RecoverSlots(1 PASS_REGS); return FALSE; } + Yap_RecoverSlots(1 PASS_REGS); if (IsVarTerm(t)) { return Yap_unify(ARG2, MkIntegerTerm(st->encoding)); }