* src/proc.c: store function pointers in typed variables before calling them.

git-svn-id: svn://svn.zoy.org/elk/trunk@261 55e467fa-43c5-0310-a8a2-de718669efc6
This commit is contained in:
sam 2006-03-02 21:07:01 +00:00
parent f6644fbe65
commit 2d0bfa1171
1 changed files with 9 additions and 3 deletions

View File

@ -274,11 +274,17 @@ Object Funcall_Primitive (Object fun, Object argl, int eval) {
prim = PRIM(fun); /* fun has possibly been moved during gc */
}
if (prim->disc == VARARGS) {
r = (prim->fun)(argc, argv);
Object (*varfun) (int, Object *);
varfun = (Object (*) (int, Object *))prim->fun;
r = varfun(argc, argv);
} else {
switch (argc) {
case 0:
r = (prim->fun)(); break;
case 0: {
Object (*myfun) (void);
myfun = (Object (*) (void))prim->fun;
r = myfun();
break;
}
case 1:
TC_Disable;
r = eval ? Eval (Car (argl)) : Car (argl);