1.1 --- a/templates/ops.c Thu Mar 23 16:40:57 2017 +0100
1.2 +++ b/templates/ops.c Fri Mar 24 17:44:52 2017 +0100
1.3 @@ -323,8 +323,11 @@
1.4
1.5 __attr (*__get_function(__attr context, __attr target))(__attr[])
1.6 {
1.7 - target = __unwrap_callable(target);
1.8 + return __get_function_unwrapped(context, __unwrap_callable(target));
1.9 +}
1.10
1.11 +__attr (*__get_function_unwrapped(__attr context, __attr target))(__attr[])
1.12 +{
1.13 /* Require null or instance contexts for functions and methods respectively,
1.14 or type instance contexts for type methods. */
1.15
1.16 @@ -336,8 +339,11 @@
1.17
1.18 __attr (*__check_and_get_function(__attr context, __attr target))(__attr[])
1.19 {
1.20 - target = __unwrap_callable(target);
1.21 + return __check_and_get_function_unwrapped(context, __unwrap_callable(target));
1.22 +}
1.23
1.24 +__attr (*__check_and_get_function_unwrapped(__attr context, __attr target))(__attr[])
1.25 +{
1.26 /* Require null or instance contexts for functions and methods respectively,
1.27 or type instance contexts for type methods. */
1.28
2.1 --- a/templates/ops.h Thu Mar 23 16:40:57 2017 +0100
2.2 +++ b/templates/ops.h Fri Mar 24 17:44:52 2017 +0100
2.3 @@ -114,7 +114,9 @@
2.4 __attr __unwrap_callable(__attr callable);
2.5 __attr (*__get_function_unchecked(__attr target))(__attr[]);
2.6 __attr (*__get_function(__attr context, __attr target))(__attr[]);
2.7 +__attr (*__get_function_unwrapped(__attr context, __attr target))(__attr[]);
2.8 __attr (*__check_and_get_function(__attr context, __attr target))(__attr[]);
2.9 +__attr (*__check_and_get_function_unwrapped(__attr context, __attr target))(__attr[]);
2.10
2.11 /* Parameter position operations. */
2.12
3.1 --- a/templates/progops.c Thu Mar 23 16:40:57 2017 +0100
3.2 +++ b/templates/progops.c Fri Mar 24 17:44:52 2017 +0100
3.3 @@ -253,7 +253,10 @@
3.4
3.5 /* Call with the prepared arguments. */
3.6
3.7 - return (always_callable ? __get_function(allargs[0], target) : __check_and_get_function(allargs[0], target))(allargs);
3.8 + return (always_callable ?
3.9 + __get_function_unwrapped(allargs[0], target) :
3.10 + __check_and_get_function_unwrapped(allargs[0], target)
3.11 + )(allargs);
3.12 }
3.13
3.14 /* Error routines. */