From 499638c08d1866a31c39af9c323d01d6c697726e Mon Sep 17 00:00:00 2001 From: sjakie Date: Mon, 8 Nov 1999 14:48:09 +0000 Subject: bug fix: arity of imported function was incorrect git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@37 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d --- frontend/trans.icl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'frontend') diff --git a/frontend/trans.icl b/frontend/trans.icl index 87925b4..a68800f 100644 --- a/frontend/trans.icl +++ b/frontend/trans.icl @@ -1609,12 +1609,16 @@ transformApplication app=:{app_symb=symb=:{symb_kind = SK_Function {glob_module, // This function is imported | isEmpty extra_args = (App app, ti) - # ar_diff = ro.ro_imported_funs.[glob_module].[glob_object].ft_arity - symb_arity +/* Sjaak ... */ + # {ft_arity,ft_type} = ro.ro_imported_funs.[glob_module].[glob_object] + form_arity = ft_arity + length ft_type.st_context + ar_diff = form_arity - symb_arity nr_of_extra_args = length extra_args | nr_of_extra_args <= ar_diff = (App {app & app_args = app_args ++ extra_args, app_symb = { symb & symb_arity = symb_arity + nr_of_extra_args }}, ti) = (App {app & app_args = app_args ++ take ar_diff extra_args, app_symb = { symb & symb_arity = symb_arity + ar_diff }} @ drop ar_diff extra_args, ti) +/* ... Sjaak */ // XXX linear_bits field has to be added for generated functions transformApplication app=:{app_symb={symb_kind = SK_GeneratedFunction fun_def_ptr _}} extra_args ro ti=:{ti_fun_heap} -- cgit v1.2.3