Changeset 31 for trunk/orca/ovalue.c

Show
Ignore:
Timestamp:
02/08/06 01:35:49 (3 years ago)
Author:
krobillard
Message:

Overflow of the quick hold stack is now caught.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/orca/ovalue.c

    r27 r31  
    304304    env->secure    = 0; 
    305305 
    306     // TODO: Do something about quickHolds stack overflow. Just use orHold()? 
    307     env->quickHolds    = memAlloc( sizeof(OHold) * 256 ); 
    308     env->quickHoldsTop = env->quickHolds; 
     306    env->quickHolds     = memAlloc( sizeof(OHold) * OR_MAX_QHOLDS ); 
     307    env->quickHoldsUsed = 0; 
    309308 
    310309    // NOTE: The data & call stacks are never resized so that it is safe 
     
    535534    env->callStack.used = 0; 
    536535    env->dataStack.used = 0; 
    537     env->quickHoldsTop = env->quickHolds; 
     536    env->quickHoldsUsed = 0; 
    538537    env->error = 0;      //orErrorClear; 
    539538} 
     
    13401339        OValue fileVal = *a1; 
    13411340 
     1341        orRefAvailErr( 2 ); 
    13421342        orRefPush( OT_FILE, a1->index ); 
    13431343        // Need to ref args? 
     
    16481648    OIndex bi   = (a1 + 1)->series.it; 
    16491649 
     1650    orRefAvailErr( 2 ) 
    16501651    orRefPush( OT_BLOCK, cond ); 
    16511652    orRefPush( OT_BLOCK, body ); 
     
    28872888        int vi; 
    28882889 
     2890        orRefAvailErr( 3 ) 
    28892891        orRefPush( OT_BLOCK, a1->index ); 
    28902892        rblk = orMakeBlock(0); 
     
    30533055    int reti; 
    30543056 
     3057    /* Check if 2 are free because there is an orRefPush in orEval() 
     3058       and we can save a check there by doing it here. 
     3059       This is the only check which will catch an endlessly recursive does. 
     3060     */ 
     3061    orRefAvailErr( 2 ) 
    30553062    orRefPush( OT_BLOCK, blkN ); 
    30563063 
     
    42394246 
    42404247 
     4248    orRefAvailErr( 4 ) 
    42414249    orRefPush( OT_BLOCK, a1->index ); 
    42424250    orRefPush( OT_BLOCK, a2->index );