Skip to content

Commit afe2a01

Browse files
toshihirok-okada
toshihiro
authored andcommitted
1. In eus.h, macro to define free() to substitute cfree()
is added for Linux and Linux64, since cfree() is made obsolete in 2018. 2. In sequence.c, start/end parameter check is corrected for arrays since specifying start>end caused a segmentation fault.
1 parent 5b7ac57 commit afe2a01

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lisp/c/eus.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ typedef float eusfloat_t;
4141
#define USE_STDARG
4242
#endif
4343

44-
#ifdef Darwin
44+
#if defined(Darwin) || defined(Linux) || defined(Linux64)
4545
#define cfree free
4646
#endif
4747

lisp/c/sequence.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,9 @@ pointer argv[];
142142
a=a->c.ary.entity;}
143143
if (isvector(a)) {
144144
count=vecsize(a);
145-
if (n==3) e=min(e,count);
145+
if (s>count) error(E_STARTEND);
146+
if (n==3) {
147+
if (e>count) error(E_STARTEND); }
146148
else e=count;
147149
count=e-s;
148150
switch(elmtypeof(a)) {

0 commit comments

Comments
 (0)