Fix undefined order of eval in while condition.
authorNelson Ferreira <nelson.ferreira@ieee.org>
Wed, 14 Sep 2011 09:27:18 +0000 (05:27 -0400)
committerNelson Ferreira <nelson.ferreira@ieee.org>
Wed, 14 Sep 2011 09:27:18 +0000 (05:27 -0400)
CID:30

src/ent/ent-float.c
src/fns.c

index f1a2e7a..d3bae21 100644 (file)
@@ -611,16 +611,14 @@ The float closest in value to -0.
                                                                       */);
        Vleast_negative_float = make_float(fp);
 
-       f = 1.0;
-       while ((fp = f, f /= 2) * 2 == fp && f != 0);
+       for( f = fp = 1.0; (f /= 2) * 2 == fp && f != 0; fp = f );
        DEFVAR_CONST_LISP("least-positive-normalised-float",
                          &Vleast_positive_normalised_float /*
 The float closest in value to +0 without rounding errors.
                                                            */);
        Vleast_positive_normalised_float = make_float(fp);
 
-       f = -1.0;
-       while ((fp = f, f /= 2) * 2 == fp && f != 0);
+       for( f = fp = -1.0; ( f /= 2) * 2 == fp && f != 0; fp = f);
        DEFVAR_CONST_LISP("least-negative-normalised-float",
                          &Vleast_negative_normalised_float /*
 The float closest in value to -0 without rounding errors.
index e438f05..d34dbbd 100644 (file)
--- a/src/fns.c
+++ b/src/fns.c
@@ -889,6 +889,7 @@ concat(int nargs, Lisp_Object * args,
                                                   XINT(elt));
                        } else {
                                CHECK_CHAR_COERCE_INT(elt);
+                                assert(string_result_ptr != NULL);
                                string_result_ptr +=
                                    set_charptr_emchar(string_result_ptr,
                                                       XCHAR(elt));