1.1 --- a/templates/ops.c Wed Aug 30 00:55:30 2023 +0200
1.2 +++ b/templates/ops.c Wed Aug 30 01:49:28 2023 +0200
1.3 @@ -452,33 +452,25 @@
1.4 replacement, a copied object is assigned when initialising the local.
1.5 NOTE: Only floats are currently supported for value replacement. */
1.6
1.7 -void __set_local(volatile __attr *local, __attr attr)
1.8 +__attr __set_local(volatile __attr *local, __attr attr)
1.9 {
1.10 __ref obj;
1.11
1.12 /* Value already replaced in target by an operation. */
1.13
1.14 if (__REPLACING(attr))
1.15 - return;
1.16 + return __REPLACED(attr);
1.17
1.18 obj = __VALUE(attr);
1.19
1.20 - /* Value not replaceable, suitable for direct propagation to a local. */
1.21 -
1.22 - if ((obj == NULL) || !__is_instance(obj) || (__get_class(obj) != &__builtins___float_float))
1.23 - *local = attr;
1.24 -
1.25 /* Value is replaceable and should be copied to avoid inadvertent
1.26 sharing. */
1.27
1.28 - else
1.29 - *local = __ATTRVALUE(__COPY(obj, sizeof(__obj___builtins___float_float)));
1.30 -}
1.31 + if ((obj != NULL) && __is_instance(obj) && (__get_class(obj) == &__builtins___float_float))
1.32 + attr = __ATTRVALUE(__COPY(obj, sizeof(__obj___builtins___float_float)));
1.33
1.34 -/* Make sure that attributes indicating value replacement are usable as
1.35 - arguments. */
1.36 + /* Set and return the attribute. */
1.37
1.38 -__attr __to_arg(__attr attr)
1.39 -{
1.40 - return __REPLACING(attr) ? __REPLACED(attr) : attr;
1.41 + *local = attr;
1.42 + return attr;
1.43 }