From 544003605bf46aee6513c8ac9abc5d25154ced73 Mon Sep 17 00:00:00 2001 From: Philip Herron Date: Wed, 10 Jul 2013 13:56:48 +0100 Subject: [PATCH] GCCPY: * New fib2.py testcase from the offical python tutorial * REGRESSION FIX calling internal C func's such as list.append were broken now fixed --- gcc/testsuite/python.test/fib2.py | 11 +++++++++++ libgpython/runtime/gpy-module-stack.c | 5 +++-- 2 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/python.test/fib2.py diff --git a/gcc/testsuite/python.test/fib2.py b/gcc/testsuite/python.test/fib2.py new file mode 100644 index 00000000000..3616ff2890a --- /dev/null +++ b/gcc/testsuite/python.test/fib2.py @@ -0,0 +1,11 @@ +def fib2 (n): + result = [] + a = 0 + b = 1 + while a < n: + result.append (a) + a = b + b = a + b + return result +f100 = fib2 (100) +print f100 diff --git a/libgpython/runtime/gpy-module-stack.c b/libgpython/runtime/gpy-module-stack.c index e8039eaee26..6e301c965d2 100644 --- a/libgpython/runtime/gpy-module-stack.c +++ b/libgpython/runtime/gpy-module-stack.c @@ -497,7 +497,8 @@ gpy_object_t * gpy_rr_fold_call (gpy_object_t * decl, int nargs, ...) // since we dont need the self reference, this will be NULL // on normal calls outside of attrib references on modules bool iscmeth = false; - if (!strcmp ("classmethod", type->identifier)) + if (!strcmp ("classmethod", type->identifier) || + !strcmp ("func", type->identifier)) iscmeth = true; if (iscmeth) @@ -663,7 +664,7 @@ void gpy_rr_eval_print (int fd, int count, ...) va_start (vl,count); gpy_object_t * it = NULL; - for (idx = 0; idxo.object_state->definition; -- 2.11.4.GIT