- ((weight <= 5 && words_to_squeeze > 0) || weight < words_to_squeeze)) {
- stackSqueeze(tso, (StgPtr)frame);
+ ((weight <= 8 && words_to_squeeze > 0) || weight < words_to_squeeze)) {
+ // threshold above bumped from 5 to 8 as a result of #2797
+ stackSqueeze(cap, tso, (StgPtr)frame);
+ tso->flags |= TSO_SQUEEZED;
+ // This flag tells threadStackOverflow() that the stack was
+ // squeezed, because it may not need to be expanded.
+ } else {
+ tso->flags &= ~TSO_SQUEEZED;