Ignore:
Timestamp:
Sep 15, 2020, 2:55:26 PM (5 years ago)
Author:
bird
Message:

kash: Cache one pstack_block since parsecmd seems to be called for each statement line in a script. Also, mark pstack blocks as 'done' before returning from parsecmd and prevent them from becoming current (curpstack) again upon popping.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kash/parser.c

    r3458 r3461  
    133133        union node *ret;
    134134        int t;
    135 
     135#ifdef KASH_SEPARATE_PARSER_ALLOCATOR
     136        pstack_block *pst = pstackallocpush(psh);
     137#endif
    136138        TRACE2((psh, "parsecmd(%d)\n", interact));
    137 #ifdef KASH_SEPARATE_PARSER_ALLOCATOR
    138         pstackallocpush(psh);
    139 #endif
     139
    140140        psh->tokpushback = 0;
    141141        psh->doprompt = interact;
     
    155155        TRACE2((psh, "parsecmd(%d) returns:\n", interact));
    156156        showtree(psh, ret);
     157#endif
     158#ifdef KASH_SEPARATE_PARSER_ALLOCATOR
     159        pstackmarkdone(pst);
    157160#endif
    158161        return ret;
Note: See TracChangeset for help on using the changeset viewer.