threadStackOverflow: check whether stack squeezing released some stack (#3677)
[ghc-hetmet.git] / rts / ThreadPaused.c
index 58c30e3..96a2367 100644 (file)
@@ -317,5 +317,10 @@ end:
     if (RtsFlags.GcFlags.squeezeUpdFrames == rtsTrue &&
        ((weight <= 5 && words_to_squeeze > 0) || weight < words_to_squeeze)) {
        stackSqueeze(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;
     }
 }