mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-07-12 23:47:34 +02:00
Check types before preserving.
This commit is contained in:
parent
3c04ce1ff3
commit
4926b6dc00
1 changed files with 8 additions and 3 deletions
|
@ -665,12 +665,19 @@
|
|||
(cat " sexp " (car sexps))
|
||||
(for-each (lambda (x) (display ", ") (display x)) (cdr sexps))
|
||||
(cat ";\n")))
|
||||
;; Declare the gc vars.
|
||||
(cond
|
||||
((pair? gc-vars)
|
||||
(cat " sexp_gc_var" num-gc-vars "(")
|
||||
(display (car gc-vars))
|
||||
(for-each (lambda (x) (display ", ") (display x)) (cdr gc-vars))
|
||||
(cat ");\n")
|
||||
(cat ");\n")))
|
||||
;; Shortcut returns should come before preserving.
|
||||
(write-validators (func-scheme-args func))
|
||||
(write-additional-checks (func-c-args func))
|
||||
;; Preserve the gc vars.
|
||||
(cond
|
||||
((pair? gc-vars)
|
||||
(cat " sexp_gc_preserve" num-gc-vars "(ctx")
|
||||
(for-each (lambda (x) (display ", ") (display x)) gc-vars)
|
||||
(cat ");\n")))))
|
||||
|
@ -925,8 +932,6 @@
|
|||
" (sexp ctx sexp_api_params(self, n)"
|
||||
(write-parameters (func-scheme-args func)) ") {\n")
|
||||
(write-locals func)
|
||||
(write-validators (func-scheme-args func))
|
||||
(write-additional-checks (func-c-args func))
|
||||
(write-temporaries func)
|
||||
(write-call func)
|
||||
(write-results func)
|
||||
|
|
Loading…
Add table
Reference in a new issue