1.1 --- a/templates/ops.c Thu Jul 12 00:15:16 2018 +0200
1.2 +++ b/templates/ops.c Thu Jul 12 18:53:58 2018 +0200
1.3 @@ -231,7 +231,7 @@
1.4
1.5 /* Context-related operations. */
1.6
1.7 -int __test_context_update(__attr context, __attr attr)
1.8 +int __test_context_update(__attr context, __attr attr, int invoke)
1.9 {
1.10 /* Return whether the context should be updated for the attribute. */
1.11
1.12 @@ -258,6 +258,11 @@
1.13 __raise_type_error();
1.14 }
1.15
1.16 + /* Without a null or instance context, an invocation cannot be performed. */
1.17 +
1.18 + if (invoke)
1.19 + __raise_unbound_method_error();
1.20 +
1.21 /* Test for access to a type class attribute using a type instance. */
1.22
1.23 if (__test_specific_type(attrcontextvalue, &__TYPE_CLASS_TYPE) && __is_type_instance(__VALUE(context)))
1.24 @@ -272,7 +277,7 @@
1.25 {
1.26 /* Update the context or return the unchanged attribute. */
1.27
1.28 - if (__test_context_update(context, attr))
1.29 + if (__test_context_update(context, attr, 0))
1.30 return __update_context(context, attr);
1.31 else
1.32 return attr;
1.33 @@ -288,7 +293,7 @@
1.34 /* Revert the local context to that employed by the attribute if the
1.35 supplied context is not appropriate. */
1.36
1.37 - if (!__test_context_update(context, attr))
1.38 + if (!__test_context_update(context, attr, 1))
1.39 contexts[target] = __CONTEXT_AS_VALUE(attr);
1.40 return attr;
1.41 }
1.42 @@ -297,7 +302,7 @@
1.43 {
1.44 /* Set the local context to the specified context if appropriate. */
1.45
1.46 - if (__test_context_update(context, __ATTRVALUE(value)))
1.47 + if (__test_context_update(context, __ATTRVALUE(value), 1))
1.48 contexts[target] = context;
1.49 return __ATTRVALUE(value);
1.50 }