1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-01 04:10:18 +02:00

add return/values hack to compile-glil for lua

* module/language/tree-il/compile-glil.scm (*primcall-ops*): Add a hack
  like 'return but for multiple values, for lua.
This commit is contained in:
Andy Wingo 2010-12-10 17:49:37 +01:00
parent ed3fd27adb
commit 9582b26c62

View file

@ -126,6 +126,8 @@
;; hack for javascript
((return . 1) . return)
;; hack for lua
(return/values . return/values)
((bytevector-u8-ref . 2) . bv-u8-ref)
((bytevector-u8-set! . 3) . bv-u8-set)
@ -411,6 +413,11 @@
(case context
((drop) (emit-code #f (make-glil-call 'drop 1))))
(maybe-emit-return))
((-1)
;; A control instruction, like return/values. Here we
;; just have to hope that the author of the tree-il
;; knew what they were doing.
*unspecified*)
(else
(error "bad primitive op: too many pushes"
op (instruction-pushes op))))))