* 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 */ prim = PRIM(fun); /* fun has possibly been moved during gc */
} }
if (prim->disc == VARARGS) { if (prim->disc == VARARGS) {
r = (prim->fun)(argc, argv); Object (*varfun) (int, Object *);
varfun = (Object (*) (int, Object *))prim->fun;
r = varfun(argc, argv);
} else { } else {
switch (argc) { switch (argc) {
case 0: case 0: {
r = (prim->fun)(); break; Object (*myfun) (void);
myfun = (Object (*) (void))prim->fun;
r = myfun();
break;
}
case 1: case 1:
TC_Disable; TC_Disable;
r = eval ? Eval (Car (argl)) : Car (argl); r = eval ? Eval (Car (argl)) : Car (argl);