| version 1.34, 2006/02/01 00:30:05 |
version 1.38, 2015/09/29 01:52:14 |
|
|
| /* $OpenXM: OpenXM/src/kan96xx/Kan/stackmachine.c,v 1.33 2005/07/18 10:55:16 takayama Exp $ */ |
/* $OpenXM: OpenXM/src/kan96xx/Kan/stackmachine.c,v 1.37 2015/09/27 08:12:42 takayama Exp $ */ |
| /* stackmachin.c */ |
/* stackmachin.c */ |
| |
|
| #include <stdio.h> |
#include <stdio.h> |
|
|
| #include <signal.h> |
#include <signal.h> |
| #include <sys/types.h> |
#include <sys/types.h> |
| |
|
| |
/* The msys2 seems to make a buffer overflow of EnvOfStackmachine[]. |
| |
The code |
| |
[(x) ring_of_differential_operators 11] define_ring |
| |
( Dx*(x+Dx) ) /ff set |
| |
causes the segfault because Mp_zero is borken. Is it a bug of msys2? |
| |
Anyway, the following definition seems to be a workaround. 2015.09 |
| |
Singnals do not work properly on msys2. (gcc -dM -E ... to see macros defs) |
| |
*/ |
| |
#if defined(__MSYS__) || defined(__CYGWIN__) |
| |
#define setjmp(e) _setjmp(e) |
| |
#define sigsetjmp(e,n) _setjmp(e) |
| |
#endif |
| |
|
| /* #define OPERAND_STACK_SIZE 2000 */ |
/* #define OPERAND_STACK_SIZE 2000 */ |
| #define OPERAND_STACK_SIZE 30000 |
#define OPERAND_STACK_SIZE 30000 |
| Line 1065 int executeToken(token) |
|
| Line 1077 int executeToken(token) |
|
| return(0); /* normal exit.*/ |
return(0); /* normal exit.*/ |
| } |
} |
| } |
} |
| if (WarningMessageMode == 1 || WarningMessageMode == 2) { |
{ |
| char tmpc[1024]; |
char tmpc[1024]; |
| if (strlen(token.token) < 900) { |
if (strlen(token.token) < 900) { |
| sprintf(tmpc,"\n%%Warning: The identifier <<%s>> is not in the system dictionary\n%% nor in the user dictionaries. Push NullObject.\n",token.token); |
sprintf(tmpc,"\n>>Warning: The identifier <<%s>> is not in the system dictionary\n>> nor in the user dictionaries. Push NullObject.\n",token.token); |
| }else {strcpy(tmpc,"Warning: identifier is not in the dictionaries.");} |
}else {strcpy(tmpc,"\n>>Warning: identifier is not in the dictionaries.\n");} |
| pushErrorStack(KnewErrorPacket(SerialCurrent,-1,tmpc)); |
/* do not use %% in a string. tmpc will be used as fprintf(stderr,tmpc); */ |
| |
if (WarningMessageMode == 1 || WarningMessageMode == 2) { |
| |
pushErrorStack(KnewErrorPacket(SerialCurrent,-1,tmpc)); |
| |
} |
| |
if (WarningMessageMode != 1) { |
| |
fprintf(Fstack,"%s",tmpc); |
| |
/*fprintf(Fstack,"(%d,%d)\n",h0,h1);*/ |
| |
} |
| |
if (Strict) { |
| |
errorStackmachine(tmpc); |
| |
} |
| |
Kpush(NullObject); |
| } |
} |
| if (WarningMessageMode != 1) { |
|
| fprintf(Fstack,"\n%%Warning: The identifier <<%s>> is not in the system dictionary\n%% nor in the user dictionaries. Push NullObject.\n",token.token); |
|
| /*fprintf(Fstack,"(%d,%d)\n",h0,h1);*/ |
|
| } |
|
| if (Strict) { |
|
| errorStackmachine("Warning: identifier is not in the dictionaries"); |
|
| } |
|
| Kpush(NullObject); |
|
| } |
} |
| } |
} |
| } else if (token.kind == EXECUTABLE_STRING) { |
} else if (token.kind == EXECUTABLE_STRING) { |