1.0.46.31: clean up mach port deallocation on x86
[sbcl.git] / src / assembly / x86-64 / assem-rtns.lisp
index 28b0c1c..b6ea237 100644 (file)
                               fun-pointer-lowtag))))
 \f
 (define-assembly-routine (throw
-                          (:return-style :none))
+                          (:return-style :raw))
                          ((:arg target (descriptor-reg any-reg) rdx-offset)
                           (:arg start any-reg rbx-offset)
                           (:arg count any-reg rcx-offset)
 
   LOOP
 
-  (let ((error (generate-error-code nil 'unseen-throw-tag-error target)))
+  (let ((error (gen-label)))
+    (assemble (*elsewhere*)
+      (emit-label error)
+
+      ;; Fake up a stack frame so that backtraces come out right.
+      (inst push rbp-tn)
+      (inst mov rbp-tn rsp-tn)
+
+      (emit-error-break nil error-trap
+                        (error-number-or-lose 'unseen-throw-tag-error)
+                        (list target)))
     (inst or catch catch)               ; check for NULL pointer
     (inst jmp :z error))