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:
parent
62bc229f4a
commit
35e64fa8c1
|
@ -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;
|
||||
|
|
2
parse.c
2
parse.c
|
@ -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
|
||||
|
|
2
picoc.c
2
picoc.c
|
@ -44,7 +44,7 @@ int main(int argc, char **argv)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (PicocPlatformSetExitPoint())
|
||||
if (PicocPlatformSetExitPoint(&pc))
|
||||
{
|
||||
PicocCleanup(&pc);
|
||||
return pc.PicocExitValue;
|
||||
|
|
7
picoc.h
7
picoc.h
|
@ -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 */
|
||||
|
|
Loading…
Reference in a new issue