diff options
Diffstat (limited to 'Build/source/texk/web2c/mplibdir')
-rw-r--r-- | Build/source/texk/web2c/mplibdir/mp.w | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/Build/source/texk/web2c/mplibdir/mp.w b/Build/source/texk/web2c/mplibdir/mp.w index acb64feed7f..469218c692b 100644 --- a/Build/source/texk/web2c/mplibdir/mp.w +++ b/Build/source/texk/web2c/mplibdir/mp.w @@ -18136,15 +18136,13 @@ new level (having, initially, the same properties as the old). @d push_input { /* enter a new input level, save the old */ if ( mp->input_ptr>mp->max_in_stack ) { mp->max_in_stack=mp->input_ptr; - /* The mp->stack_size < 1001 condition is necessary to prevent stack overflow due infinite recursion. */ - if ( mp->input_ptr==mp->stack_size && mp->stack_size < 1001) { - int l = (mp->stack_size+(mp->stack_size/4)); - XREALLOC(mp->input_stack, l, in_state_record); - mp->stack_size = l; - } else { - fprintf(stderr, "input stack overflow\n"); - exit(EXIT_FAILURE); - } + if ( mp->input_ptr==mp->stack_size ) { + int l = (mp->stack_size+(mp->stack_size/4)); + /* The mp->stack_size < 1001 condition is necessary to prevent C stack overflow due infinite recursion. */ + if (l>1000) {fprintf(stderr, "input stack overflow\n");exit(EXIT_FAILURE);} + XREALLOC(mp->input_stack, l, in_state_record); + mp->stack_size = l; + } } mp->input_stack[mp->input_ptr]=mp->cur_input; /* stack the record */ incr(mp->input_ptr); |