- Subject: Stack Overflow: Block stack overflow
- From: Miguel Nicolau <Miguel.Nicolau@xxxxx>
- Date: Wed, 27 Aug 2003 14:18:31 +0100 (IST)
Hi all,
this is my first message to this list, and I couldn't find a solution for
my problem on the newsgroup (please forgive me if it was there!)
I have recently started to work with s-lang, and find it an excelent
interpreter to use within a C program. I am working with automatically
generated code, and so need to interpret loads of different (and weirdly
constructed) chunks of code.
A week ago I have found the following problem, which I believe comes from
the s-lang interpreter. When trying to interpret a chunk of code, I get
the following error:
S-Lang Error: Stack Overflow: Block stack overflow
S-Lang Error: Stack Overflow: called from line 50, file: ./if.sl
Error loading if.sl!
The c code is as follows:
-----------------------------------------------------------------
#include<slang.h>
#include<stdio.h>
int main(){
/* Init S-lang interface */
if (-1 == SLang_init_slang ()){ /* basic interpreter functions */
fprintf(stderr,"Could not initialise slang\n");
return SLang_Error;
}
if (-1 == SLang_load_file ("if.sl")){
fprintf(stderr,"Error loading if.sl!\n");
}
return 0;
}
-----------------------------------------------------------------
The "if.sl" file (which I am attaching) consists of 100 if-statements
within each other. It crashes after 50 of them, which suggests to me that
there is a buffer of 50 calls defined somewhere within the interpreter. Is
there a way to change the size of this buffer through a function call? If
yes, which function, if not, where in the s-lang sources is this buffer
size defined (so I can adapt it for my needs)?
Thanks very much in advance!
Take care
Miguel
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
if (1){
} } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } } }
[2003 date index]
[2003 thread index]
[Thread Prev] [Thread Next]
[Date Prev] [Date Next]