Fixed a regression I added while implementing re-entrancy.

git-svn-id: http://picoc.googlecode.com/svn/trunk@582 21eae674-98b7-11dd-bd71-f92a316d2d60
This commit is contained in:
zik.saleeba 2012-09-23 08:13:05 +00:00
parent 62bc229f4a
commit 35e64fa8c1
4 changed files with 9 additions and 7 deletions

View file

@ -445,7 +445,12 @@ struct Picoc_Struct
const char *VersionString;
/* exit longjump buffer */
#if defined(UNIX_HOST) || defined(WIN32)
jmp_buf PicocExitBuf;
#endif
#ifdef SURVEYOR_HOST
int PicocExitBuf[41];
#endif
/* string table */
struct Table StringTable;

View file

@ -883,7 +883,7 @@ void PicocParseInteractiveNoStartPrompt(Picoc *pc, int EnableDebugger)
enum ParseResult Ok;
LexInitParser(&Parser, pc, NULL, NULL, pc->StrEmpty, TRUE, EnableDebugger);
PicocPlatformSetExitPoint();
PicocPlatformSetExitPoint(pc);
LexInteractiveClear(pc, &Parser);
do

View file

@ -44,7 +44,7 @@ int main(int argc, char **argv)
}
else
{
if (PicocPlatformSetExitPoint())
if (PicocPlatformSetExitPoint(&pc))
{
PicocCleanup(&pc);
return pc.PicocExitValue;

View file

@ -22,18 +22,15 @@
#if defined(UNIX_HOST) || defined(WIN32)
#include <setjmp.h>
/* mark where to end the program for platforms which require this */
extern jmp_buf PicocExitBuf;
/* this has to be a macro, otherwise errors will occur due to the stack being corrupt */
#define PicocPlatformSetExitPoint() setjmp(PicocExitBuf)
#define PicocPlatformSetExitPoint(pc) setjmp((pc)->PicocExitBuf)
#endif
#ifdef SURVEYOR_HOST
/* mark where to end the program for platforms which require this */
extern int PicocExitBuf[];
#define PicocPlatformSetExitPoint() setjmp(PicocExitBuf)
#define PicocPlatformSetExitPoint(pc) setjmp((pc)->PicocExitBuf)
#endif
/* parse.c */