From de043e3ee907f350b349ce78d6f6b57247f2bf3d Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Wed, 29 Oct 2008 18:19:15 +0000 Subject: [PATCH] generate an Error on memory overflow. --- C/c_interface.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/C/c_interface.c b/C/c_interface.c index a93f63a96..9d76e14fe 100644 --- a/C/c_interface.c +++ b/C/c_interface.c @@ -669,8 +669,10 @@ YAP_MkBlobTerm(unsigned int sz) BACKUP_H(); while (H+(sz+sizeof(MP_INT)/sizeof(CELL)+2) > ASP-1024) { - if (!doexpand((sz+sizeof(MP_INT)/sizeof(CELL)+2)*sizeof(CELL))) + if (!doexpand((sz+sizeof(MP_INT)/sizeof(CELL)+2)*sizeof(CELL))) { + Yap_Error(OUT_OF_STACK_ERROR, TermNil, "YAP failed to grow the stack while constructing a blob: %s", Yap_ErrorMessage); return TermNil; + } } I = AbsAppl(H); H[0] = (CELL)FunctorBigInt;