Issue #467 - Allow passing negative value to make-list

This should result in an empty list, NOT consume all available resources!
This commit is contained in:
Justin Ethier 2021-07-19 17:04:52 -04:00
parent c58a9927ae
commit 29033581ad
2 changed files with 6 additions and 5 deletions

View file

@ -4,12 +4,13 @@
Bug Fixes
- Allow a record type to contain fields that are not initialized by the constructor.
- Fixed `read-line` to prevent data loss when used in conjunction with other I/O functions (such as `read-char`) to read data from the same port. This was because the previous version of `read-line` used a different internal buffer than our other I/O functions.
- Properly handle vectors literals at the top level of compiled code. Previously this could lead to segmentation faults (!!) at runtime.
- Properly escape question marks within strings in generated C code to avoid trigraphs.
- Fixed a bug in `make-list` that consumed all available memory when passing a negative list length.
- Eliminate clang compiler warnings referencing `EOF` when building the runtime.
- Fixed code so that the C compiler will no longer generate warnings regarding the string comparisons in `Cyc_st_add`. Previously this could result in these warnings being spammed to the console when compiling code using Cyclone.
- Allow a record type to contain fields that are not initialized by the constructor.
- Properly escape question marks within strings in generated C code to avoid trigraphs.
## 0.30.0 - July 2, 2021

View file

@ -840,9 +840,9 @@
(car fill)))
(make
(lambda (n obj)
(if (zero? n)
'()
(cons obj (make (- n 1) obj) )))))
(if (> n 0)
(cons obj (make (- n 1) obj) )
'() ))))
(make k x)))
(define (list-copy ls)
(let lp ((ls ls) (res '()))