Lichen

Changeset

834:1b1c1664e774
2018-07-02 Paul Boddie raw files shortlog changelog graph Employ an explicit temporary variable for the object reference in __BOOL.
templates/progops.c (file)
     1.1 --- a/templates/progops.c	Mon Jun 25 14:27:00 2018 +0200
     1.2 +++ b/templates/progops.c	Mon Jul 02 17:53:15 2018 +0200
     1.3 @@ -1,6 +1,6 @@
     1.4  /* Operations depending on program specifics.
     1.5  
     1.6 -Copyright (C) 2015, 2016, 2017 Paul Boddie <paul@boddie.org.uk>
     1.7 +Copyright (C) 2015, 2016, 2017, 2018 Paul Boddie <paul@boddie.org.uk>
     1.8  
     1.9  This program is free software; you can redistribute it and/or modify it under
    1.10  the terms of the GNU General Public License as published by the Free Software
    1.11 @@ -301,7 +301,9 @@
    1.12  {
    1.13      /* Invoke the bool function with the object and test against True. */
    1.14  
    1.15 -    return __VALUE(attr) == &__predefined___builtins___boolean_True ? 1 :
    1.16 -           __VALUE(attr) == &__predefined___builtins___boolean_False ? 0 :
    1.17 +    __ref value = __VALUE(attr);
    1.18 +
    1.19 +    return value == &__predefined___builtins___boolean_True ? 1 :
    1.20 +           value == &__predefined___builtins___boolean_False ? 0 :
    1.21             __VALUE(__fn___builtins___boolean_bool(__NULL, attr)) == &__predefined___builtins___boolean_True;
    1.22  }