Index: /trunk/ccl/compiler/X86/x862.lisp
===================================================================
--- /trunk/ccl/compiler/X86/x862.lisp	(revision 5872)
+++ /trunk/ccl/compiler/X86/x862.lisp	(revision 5873)
@@ -4862,9 +4862,13 @@
     (with-x86-local-vinsn-macros (seg)
       (when (neq 0 nlevels)
-        (let* ((numnlispareas 0))
-          (declare (fixnum numnlispareas))
-          (flet ((popnlispareas ()
-                   (dotimes (i numnlispareas)
+        (let* ((num-temp-frames 0)
+               (num-c-frames 0))
+          (declare (fixnum numnlispareas num-c-frames))
+          (flet ((pop-temp-frames ()
+                   (dotimes (i num-temp-frames)
                      (! discard-temp-frame)))
+                 (pop-c-frames ()
+                   (dotimes (i num-c-frames)
+                     (! discard-c-frame)))
                  (throw-through-numnthrow-catch-frames ()
                    (when (neq 0 numnthrow)
@@ -4881,11 +4885,13 @@
             (while (%i> n dest)
               (cond ((eql $undocatch (setq reason (aref *x862-undo-because* (setq n (%i- n 1)))))
-                     (popnlispareas)
+                     (pop-temp-frames)
+                     (pop-c-frames)
                      (setq numnthrow (%i+ numnthrow 1) lastcatch n))
                     ((eql $undostkblk reason)
                      (throw-through-numnthrow-catch-frames)
-                     (incf numnlispareas))
+                     (incf num-temp-frames))
                     ((eql $undo-x86-c-frame reason)
-                     (! discard-c-frame))))
+                     (throw-through-numnthrow-catch-frames)
+                     (incf num-c-frames))))
             (throw-through-numnthrow-catch-frames)
             (setq i lastcatch)
@@ -4910,5 +4916,5 @@
                       (! slide-values))
                     (! adjust-vsp vdiff)))))
-            (setq numnlispareas 0)
+            (setq num-temp-frames 0 num-c-frames 0)
             (while (%i> lastcatch dest)
               (let ((reason (aref *x862-undo-because* (setq lastcatch (%i- lastcatch 1)))))
@@ -4916,10 +4922,13 @@
                                                (x862-decode-stack (aref *x862-undo-stack* lastcatch))))
                 (if (eq reason $undostkblk)
-                  (incf numnlispareas))
+                  (incf num-temp-frames))
+                (if (eq reason $undo-x86-c-frame)
+                  (incf num-c-frames))
                 (if (%i> cstack target-cstack)
                   (error "bug: adjust foreign stack ??"))
                 ;; else what's going on? $sp-stkcons, for one thing
                 (setq cstack target-cstack)))
-            (popnlispareas)))
+            (pop-temp-frames)
+            (pop-c-frames)))
         vstack))))
 
@@ -8307,6 +8316,5 @@
         (when (zerop total-words)
           (setq simple-foreign-args nil))
-        (! alloc-c-frame (ash (+ 8 (logandc2 (1+ total-words) 1))
-                              *x862-target-fixnum-shift*)))
+        (! alloc-c-frame total-words))
       (x862-open-undo $undo-x86-c-frame)
       (setq ngpr-args 0)
@@ -8421,6 +8429,5 @@
         (when (null argspecs)
           (setq simple-foreign-args t))
-        (! alloc-c-frame (ash (+ 8 (logandc2 (1+ total-words) 1))
-                              *x862-target-fixnum-shift*)))
+        (! alloc-c-frame total-words))
       (x862-open-undo $undo-x86-c-frame)
       (setq single-float-offset (+ other-offset nother-words))
