mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-18 21:29:19 +02:00
fix sexp_opcode_argn_type initialization with gaps between the 3rd arg and k>4th arg
This commit is contained in:
parent
afb4a432c9
commit
80d2db51d8
1 changed files with 6 additions and 5 deletions
|
@ -1826,19 +1826,20 @@
|
||||||
(type-id-init-value (func-ret-type func)) ";\n"
|
(type-id-init-value (func-ret-type func)) ";\n"
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(let lp ((ls (func-c-args func))
|
(let lp ((ls (func-c-args func))
|
||||||
(i 1))
|
(i 1)
|
||||||
|
(vec? #f))
|
||||||
(cond
|
(cond
|
||||||
((null? ls))
|
((null? ls))
|
||||||
;; ((type-value (car ls))
|
;; ((type-value (car ls))
|
||||||
;; (lp (cdr ls) i))
|
;; (lp (cdr ls) i))
|
||||||
((eq? 'sexp (type-base (car ls)))
|
((eq? 'sexp (type-base (car ls)))
|
||||||
(lp (cdr ls) (+ i 1)))
|
(lp (cdr ls) (+ i 1) vec?))
|
||||||
((<= i 3)
|
((<= i 3)
|
||||||
(cat " sexp_opcode_arg" i "_type(" var ") = "
|
(cat " sexp_opcode_arg" i "_type(" var ") = "
|
||||||
(type-id-init-value (car ls)) ";\n")
|
(type-id-init-value (car ls)) ";\n")
|
||||||
(lp (cdr ls) (+ i 1)))
|
(lp (cdr ls) (+ i 1) vec?))
|
||||||
(else
|
(else
|
||||||
(if (= i 4)
|
(if (not vec?)
|
||||||
(cat " sexp_opcode_argn_type(" var ") = "
|
(cat " sexp_opcode_argn_type(" var ") = "
|
||||||
"sexp_make_vector(ctx, "
|
"sexp_make_vector(ctx, "
|
||||||
(make-integer (- (length (func-c-args func)) 3)) ", "
|
(make-integer (- (length (func-c-args func)) 3)) ", "
|
||||||
|
@ -1846,7 +1847,7 @@
|
||||||
(cat " sexp_vector_set(sexp_opcode_argn_type(" var "), "
|
(cat " sexp_vector_set(sexp_opcode_argn_type(" var "), "
|
||||||
(make-integer (- i 4)) ", "
|
(make-integer (- i 4)) ", "
|
||||||
(type-id-init-value (car ls)) ");\n")
|
(type-id-init-value (car ls)) ");\n")
|
||||||
(lp (cdr ls) (+ i 1))))))
|
(lp (cdr ls) (+ i 1) #t)))))
|
||||||
;; " } else {\n"
|
;; " } else {\n"
|
||||||
;; " sexp_warn(ctx, \"couldn't generated opcode\", " var ");\n"
|
;; " sexp_warn(ctx, \"couldn't generated opcode\", " var ");\n"
|
||||||
" }\n")))
|
" }\n")))
|
||||||
|
|
Loading…
Add table
Reference in a new issue