X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/sod/blobdiff_plain/7f2917d28642cfbdf590ff26f0cdd91a79b1c489..167524b5890cdbf4a832b1766a328f6d8a1f8f04:/src/method-proto.lisp diff --git a/src/method-proto.lisp b/src/method-proto.lisp index d176602..069f7e4 100644 --- a/src/method-proto.lisp +++ b/src/method-proto.lisp @@ -7,7 +7,7 @@ ;;;----- Licensing notice --------------------------------------------------- ;;; -;;; This file is part of the Sensble Object Design, an object system for C. +;;; This file is part of the Sensible Object Design, an object system for C. ;;; ;;; SOD is free software; you can redistribute it and/or modify ;;; it under the terms of the GNU General Public License as published by @@ -292,15 +292,13 @@ (defun invoke-method (codegen target arguments-tail direct-method) (convert-stmts codegen target (c-type-subtype (sod-method-type direct-method)) (lambda (var) - (ensure-var codegen *sod-tmp-ap* (c-type va-list)) - (emit-inst codegen - (make-va-copy-inst *sod-tmp-ap* - *sod-ap*)) - (deliver-expr codegen var - (make-call-inst function arguments)) - (emit-inst codegen - (make-va-end-inst *sod-tmp-ap*)))) - (deliver-expr codegen target (make-call-inst function arguments))))) + (ensure-var codegen *sod-tmp-ap* c-type-va-list) + (deliver-call codegen :void "va_copy" + *sod-tmp-ap* *sod-ap*) + (apply #'deliver-call codegen var + function arguments) + (deliver-call codegen :void "va_end" *sod-tmp-ap*))) + (apply #'deliver-call codegen target function arguments)))) (export 'ensure-ilayout-var) (defun ensure-ilayout-var (codegen super) @@ -338,8 +336,7 @@ (defun make-trampoline (codegen super body) (return-type (c-type-subtype message-type)) (raw-args (sod-message-argument-tail message)) (arguments (if (varargs-message-p message) - (cons (make-argument *sod-ap* - (c-type va-list)) + (cons (make-argument *sod-ap* c-type-va-list) (butlast raw-args)) raw-args))) (codegen-push codegen)