Various VM stack management fixes
[bpt/guile.git] / libguile / vm-engine.c
index 5edadd3..b5cd095 100644 (file)
 #define ALLOC_FRAME(n)                                              \
   do {                                                              \
     vp->sp = LOCAL_ADDRESS (n - 1);                                 \
-    CHECK_OVERFLOW ();                                              \
     if (vp->sp > vp->sp_max_since_gc)                               \
-      vp->sp_max_since_gc = vp->sp;                                 \
+      {                                                             \
+        vp->sp_max_since_gc = vp->sp;                               \
+        CHECK_OVERFLOW ();                                          \
+      }                                                             \
   } while (0)
 
 /* Reset the current frame to hold N locals.  Used when we know that no