From 499adf4cf46dda9ebc8f3fc5c9b88effa72f52a9 Mon Sep 17 00:00:00 2001 From: vsc Date: Wed, 27 Feb 2002 01:20:18 +0000 Subject: [PATCH] copy value structs to stack git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@389 b08c6af1-5177-4d33-ba66-4b1c6b8b522a --- C/adtdefs.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/C/adtdefs.c b/C/adtdefs.c index 9992a1144..fd77e8bba 100644 --- a/C/adtdefs.c +++ b/C/adtdefs.c @@ -456,6 +456,19 @@ GetValue(Atom a) return (TermNil); READ_LOCK(RepValProp(p0)->VRWLock); out = RepValProp(p0)->ValueOfVE; + if (IsApplTerm(out)) { + Functor f = FunctorOfTerm(out); + if (f == FunctorDouble) { + out = MkFloatTerm(FloatOfTerm(out)); + } else if (f == FunctorLongInt) { + out = MkLongIntTerm(LongIntOfTerm(out)); + } +#ifdef USE_GMP + else { + out = MkBigIntTerm(BigIntOfTerm(out)); + } +#endif + } READ_UNLOCK(RepValProp(p0)->VRWLock); return (out); }