~trn/reduce-algebra

ce853da0c76eaffe362654cb7cf82fa4cb91e7c3 — Arthur C. Norman 2 months ago 89bb926
CSL: there was a problem with empty strings in some cases. I believe
that this most frequently showed up on versions of operating systems where
listing the files in a directory (via '(list!-directory ".")') could give
me an empty name as if it was a file-name. Processing tha could lead to
a crash. I had encountered that for 32-bit systems but failed to fix it
for 64-bit ones - perhaps because to test a 32-bit system I had been using
and old version of Linux that generated the "odd" name while the more
recent versions I tested for 64-bits did not. However eg Ubuntu 18.04
seemed to trigger this for me. The recent 64-bit crash there was because
older code had been bad but not in ways that showed up so much, but when I
corrected things so that 32-bit systems got empty strings better handled
I had left 32-bit ones better overall but bad in the particular case of empty
strings.


git-svn-id: https://svn.code.sf.net/p/reduce-algebra/code/trunk@6438 2bfe0521-f11c-4a00-b80e-6202646ff360
2 files changed, 2 insertions(+), 2 deletions(-)

M csl/cslbase/cslread.cpp
M csl/cslbase/version.h
M csl/cslbase/cslread.cpp => csl/cslbase/cslread.cpp +1 -1
@@ 99,7 99,7 @@ LispObject make_string(const char *b)
// of those is the padder. Using memset probably leads to compilation that
// writes the zeros with a word memory access but avoids C++ worries
// about strict aliasing.
    if (SIXTY_FOUR_BIT || n%8 > 4)
    if ((SIXTY_FOUR_BIT && n!=0) || n%8 > 4)
        std::memset(s+k-8, 0, 8);
    else std::memset(s+k-4, 0, 4);
    std::memcpy(s + CELL, b, (size_t)n);

M csl/cslbase/version.h => csl/cslbase/version.h +1 -1
@@ 39,7 39,7 @@
// (scripts/commit.sh) that is used to update the subversion repository to
// update the revision number here.

#define REVISION 6437
#define REVISION 6438

#endif // header_version_h