Raymond Toy pushed to branch issue-306-lisp.c at cmucl / cmucl
Commits:
0319c582 by Carl Shapiro at 2024-04-28T12:05:17-07:00
Abort if make_var cannot allocate memory with malloc
There are two calls to malloc in this function. Previously, just the
first checked for an error. This change adds a similar check to the
second call.
- - - - -
f4e19102 by Carl Shapiro at 2024-07-22T17:59:28-07:00
Add a .dir-locals.el file for Emacs
This matches the settings in the .editorconfig file.
- - - - -
1b169581 by Carl Shapiro at 2024-07-23T06:42:31+00:00
Merge branch 'dirlocalsel' into 'master'
Add a .dir-locals.el file for Emacs
See merge request cmucl/cmucl!228
- - - - -
1b3171cd by Carl Shapiro at 2024-07-25T07:12:17+00:00
Merge branch 'vars-c-unchecked-malloc' into 'master'
Abort if make_var cannot allocate memory with malloc
See merge request cmucl/cmucl!216
- - - - -
8e31e57e by Raymond Toy at 2024-07-25T13:15:44+00:00
Fix #342: Add CI to run static analyzer on C code
- - - - -
4e53aac5 by Raymond Toy at 2024-07-25T13:15:50+00:00
Merge branch 'issue-342-add-ci-static-analyzer' into 'master'
Fix #342: Add CI to run static analyzer on C code
Closes #342
See merge request cmucl/cmucl!239
- - - - -
b6a449dd by Raymond Toy at 2024-07-25T13:16:27+00:00
Fix #341: Update version features in cross-compile scripts
- - - - -
5ad8c86e by Raymond Toy at 2024-07-25T13:16:29+00:00
Merge branch 'issue-341-update-version-feature-for-xcompile' into 'master'
Fix #341: Update version features in cross-compile scripts
Closes #341
See merge request cmucl/cmucl!238
- - - - -
aabe67a0 by Raymond Toy at 2024-07-25T13:16:53+00:00
Fix #340: Use +ascii-limit+ in srctran.lisp
- - - - -
8a2dbcb3 by Raymond Toy at 2024-07-25T13:16:57+00:00
Merge branch 'issue-340-srctran-use-ascii-limit' into 'master'
Fix #340: Use +ascii-limit+ in srctran.lisp
Closes #340 and #337
See merge request cmucl/cmucl!237
- - - - -
a5e42f73 by Raymond Toy at 2024-07-25T14:58:09+00:00
Fix #336: Change declaration from "ignore" to "ignorable"
- - - - -
76b67529 by Raymond Toy at 2024-07-25T14:58:12+00:00
Merge branch 'issue-336-3-standard-ignorable' into 'master'
Fix #336: Change declaration from "ignore" to "ignorable"
Closes #336
See merge request cmucl/cmucl!236
- - - - -
c4488c0c by Raymond Toy at 2024-07-25T15:30:06-07:00
Merge branch 'master' into issue-306-lisp.c
Mostly to get the CI analyzer job.
- - - - -
11 changed files:
- + .dir-locals.el
- .gitlab-ci.yml
- src/compiler/srctran.lisp
- src/compiler/x86/call.lisp
- src/lisp/vars.c
- src/tools/cross-scripts/cross-x86-netbsd.lisp
- src/tools/cross-scripts/cross-x86-osx-freebsd.lisp
- src/tools/cross-scripts/cross-x86-osx-solaris.lisp
- src/tools/cross-scripts/cross-x86-ppc-darwin.lisp
- src/tools/cross-scripts/cross-x86-sparc.lisp
- src/tools/cross-scripts/cross-x86-x86.lisp
Changes:
=====================================
.dir-locals.el
=====================================
@@ -0,0 +1,6 @@
+((nil
+ (indent-tabs-mode . t)
+ (require-final-newline . t)
+ (tab-width . 8))
+ (c-mode
+ (c-basic-offset . 4)))
=====================================
.gitlab-ci.yml
=====================================
@@ -10,6 +10,7 @@ stages:
- test
- ansi-test
- benchmark
+ - analyze
cache:
@@ -36,7 +37,7 @@ linux:build:
- dist/
- linux-2/*.log
- linux-3/*.log
- - linux-4/*.log
+ - linux-4/
needs:
- job: linux:install
artifacts: true
@@ -45,8 +46,10 @@ linux:build:
#- bin/create-target.sh xtarget x86_linux_clang
#- bin/create-target.sh xcross x86_linux_clang
#- bin/cross-build-world.sh -crl -B boot-2020-04-1 xtarget xcross src/tools/cross-scripts/cross-x86-x86.lisp snapshot/bin/lisp
- # Regular build using the cross-compiled result or snapshot
- - bin/build.sh $bootstrap -R -C "x86_linux_clang" -o snapshot/bin/lisp
+ # Regular build using the cross-compiled result or snapshot. The
+ # analyzer job requires gcc, so make sure we build with gcc here
+ # instead of clang.
+ - bin/build.sh $bootstrap -R -C "x86_linux" -o snapshot/bin/lisp
# - bin/build.sh $bootstrap -R -C "x86_linux" -o snapshot/bin/lisp
# Use -V to specify the version in case some tag makes git
# describe return something that make-dist.sh doesn't like.
@@ -62,6 +65,8 @@ linux:cross-build:
- linux-2/*.log
- linux-3/*.log
- linux-4/*.log
+ # The lisp directory is needed for the static analyzer job.
+ - linux-4/lisp
needs:
# Normally need the linux:install stage to get the compiler to
@@ -232,3 +237,24 @@ osx:benchmark:
- CMUCL=../../snapshot/bin/lisp ./run-cmucl.sh
- CMUCL=../../dist/bin/lisp ./run-cmucl.sh
- ../../snapshot/bin/lisp -load report
+
+# Optional job that runs the static analyzer. It needs the files from
+# the linux-4 directory built in the linux:build job.
+linux:static-analyzer:
+ stage: analyze
+ when: manual
+ tags:
+ - linux
+ artifacts:
+ paths:
+ - analyzer.log
+ needs:
+ - job: linux:build
+ artifacts: true
+ script:
+ # Analysis can generate huge amounts of output. For now just save
+ # the results to the log file instead of also having it go to the
+ # console. If someday there's less or no output, we can consider
+ # having the logs go to the console too.
+ - make -C linux-4/lisp clean
+ - make -C linux-4/lisp CFLAGS=-fanalyzer > analyzer.log 2>&1
=====================================
src/compiler/srctran.lisp
=====================================
@@ -3313,8 +3313,8 @@
#+(and unicode (not unicode-bootstrap))
'(let* ((ac (char-code a))
(bc (char-code b)))
- (if (and (<= ac #x7f)
- (<= bc #x7f))
+ (if (and (<= ac +ascii-limit+)
+ (<= bc +ascii-limit+))
;; ASCII
(let ((sum (logxor ac bc)))
(or (zerop sum)
=====================================
src/compiler/x86/call.lisp
=====================================
@@ -49,7 +49,9 @@
;;; No problems.
;#+nil
(def-vm-support-routine make-return-pc-passing-location (standard)
- (declare (ignore standard))
+ ;; Should be IGNORE, not IGNORABLE; We're just silencing a compiler
+ ;; note.
+ (declare (ignorable standard))
(make-wired-tn (primitive-type-or-lose 'system-area-pointer *backend*)
sap-stack-sc-number return-pc-save-offset))
;;;
@@ -77,7 +79,9 @@
;;; No problems
;#+nil
(def-vm-support-routine make-old-fp-passing-location (standard)
- (declare (ignore standard))
+ ;; Should be IGNORE, not IGNORABLE; We're just silencing a compiler
+ ;; note.
+ (declare (ignorable standard))
(make-wired-tn *fixnum-primitive-type* control-stack-sc-number
ocfp-save-offset))
;;;
=====================================
src/lisp/vars.c
=====================================
@@ -128,6 +128,10 @@ make_var(char *name, boolean perm)
name = buffer;
}
var->name = (char *) malloc(strlen(name) + 1);
+ if (var->name == NULL) {
+ perror("malloc");
+ exit(1);
+ }
strcpy(var->name, name);
var->clock = 0;
var->permanent = perm;
=====================================
src/tools/cross-scripts/cross-x86-netbsd.lisp
=====================================
@@ -22,7 +22,7 @@
:conservative-float-type
:hash-new
:random-mt19937
- :cmu :cmu20 :cmu20a ; Version features
+ :cmu :cmu21 :cmu21e ; Version features
:double-double ; double-double float support
)
;; Features to remove from current *features* here. Normally don't
=====================================
src/tools/cross-scripts/cross-x86-osx-freebsd.lisp
=====================================
@@ -26,7 +26,7 @@
:complex-fp-vops
:hash-new
:random-mt19937
- :cmu :cmu20 :cmu20b ; Version features
+ :cmu :cmu21 :cmu21e ; Version features
:double-double ; double-double float support
:linkage-table
=====================================
src/tools/cross-scripts/cross-x86-osx-solaris.lisp
=====================================
@@ -26,7 +26,7 @@
:complex-fp-vops
:hash-new
:random-mt19937
- :cmu :cmu20 :cmu20b ; Version features
+ :cmu :cmu21 :cmu21e ; Version features
:double-double ; double-double float support
:linkage-table
=====================================
src/tools/cross-scripts/cross-x86-ppc-darwin.lisp
=====================================
@@ -17,7 +17,7 @@
:darwin ; Darwin OS (Mac OS X)
:bsd ; We're a BSD-type OS
:cmu ; Announce this is CMUCL
- :cmu20 :cmu20a ; (Mostly) current version identifier
+ :cmu21 :cmu21e ; (Mostly) current version identifier
:gencgc ; Generational GC is supported on ppc.
:relative-package-names
:modular-arith ; Modular arithmetic
=====================================
src/tools/cross-scripts/cross-x86-sparc.lisp
=====================================
@@ -23,7 +23,7 @@
:hash-new
:random-mt19937 ; MT-19937 generator
:cmu ; Announce this is CMUCL
- :cmu20 :cmu20b ; Current version identifier
+ :cmu21 :cmu21e ; Current version identifier
:modular-arith ; Modular arithmetic
:double-double ; Double-double float support
:executable
=====================================
src/tools/cross-scripts/cross-x86-x86.lisp
=====================================
@@ -21,7 +21,7 @@
:conservative-float-type
:hash-new
:random-xoroshiro ; RNG
- :cmu :cmu20 :cmu20a ; Version features
+ :cmu :cmu21 :cmu21e ; Version features
:double-double ; double-double float support
)
;; Features to remove from current *features* here. Normally don't
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/97331203e14b0e88f482fe…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/97331203e14b0e88f482fe…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch master at cmucl / cmucl
Commits:
a5e42f73 by Raymond Toy at 2024-07-25T14:58:09+00:00
Fix #336: Change declaration from "ignore" to "ignorable"
- - - - -
76b67529 by Raymond Toy at 2024-07-25T14:58:12+00:00
Merge branch 'issue-336-3-standard-ignorable' into 'master'
Fix #336: Change declaration from "ignore" to "ignorable"
Closes #336
See merge request cmucl/cmucl!236
- - - - -
1 changed file:
- src/compiler/x86/call.lisp
Changes:
=====================================
src/compiler/x86/call.lisp
=====================================
@@ -49,7 +49,9 @@
;;; No problems.
;#+nil
(def-vm-support-routine make-return-pc-passing-location (standard)
- (declare (ignore standard))
+ ;; Should be IGNORE, not IGNORABLE; We're just silencing a compiler
+ ;; note.
+ (declare (ignorable standard))
(make-wired-tn (primitive-type-or-lose 'system-area-pointer *backend*)
sap-stack-sc-number return-pc-save-offset))
;;;
@@ -77,7 +79,9 @@
;;; No problems
;#+nil
(def-vm-support-routine make-old-fp-passing-location (standard)
- (declare (ignore standard))
+ ;; Should be IGNORE, not IGNORABLE; We're just silencing a compiler
+ ;; note.
+ (declare (ignorable standard))
(make-wired-tn *fixnum-primitive-type* control-stack-sc-number
ocfp-save-offset))
;;;
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/8a2dbcb3f8b7262f186f55…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/8a2dbcb3f8b7262f186f55…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch issue-306-lisp.c at cmucl / cmucl
Commits:
97331203 by Raymond Toy at 2024-07-25T06:55:48-07:00
Clean up formatting of args of check_ptr
- - - - -
1 changed file:
- src/lisp/lisp.c
Changes:
=====================================
src/lisp/lisp.c
=====================================
@@ -45,7 +45,7 @@
static void
-check_ptr(const void* ptr, const char* msg)
+check_ptr(const void *ptr, const char *msg)
{
if (ptr == NULL) {
perror(msg);
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/97331203e14b0e88f482fe9…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/97331203e14b0e88f482fe9…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch issue-306-lisp.c at cmucl / cmucl
Commits:
85f8ed4e by Raymond Toy at 2024-07-25T06:49:51-07:00
Don't need to do strdup when setting cmucllib in main()
As noted by @cshapiro, `cmucllib` isn't modified so in the couple of
places we don't need to use strdup because:
* `cmucllib` isn't modified anywhere
* the variables where strdup was called are never changed either so
`cmucllib` wouldn't get modified in weird ways either.
Static analyzer doesn't complain, and we get to remove a couple of
calls to `check_ptr`.
- - - - -
1 changed file:
- src/lisp/lisp.c
Changes:
=====================================
src/lisp/lisp.c
=====================================
@@ -758,15 +758,13 @@ main(int argc, const char *argv[], const char *envp[])
* neither are set, set cmucllib to our default search path.
*/
if (lib != NULL) {
- cmucllib = strdup(lib);
- check_ptr(cmucllib, "No space for strdup(lib)");
+ cmucllib = lib;
} else {
char *libvar;
libvar = getenv("CMUCLLIB");
if (libvar != NULL) {
- cmucllib = strdup(libvar);
- check_ptr(cmucllib, "No space for strdup(libvar)");
+ cmucllib = libvar;
} else {
/*
* The following doesn't make sense for executables. They
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/85f8ed4ee05fe087907bfc3…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/85f8ed4ee05fe087907bfc3…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch issue-336-3-standard-ignorable at cmucl / cmucl
Commits:
8e121dc5 by Raymond Toy at 2024-07-25T06:19:42-07:00
Add comment that IGNORABLE should be IGNORE
- - - - -
1 changed file:
- src/compiler/x86/call.lisp
Changes:
=====================================
src/compiler/x86/call.lisp
=====================================
@@ -49,6 +49,8 @@
;;; No problems.
;#+nil
(def-vm-support-routine make-return-pc-passing-location (standard)
+ ;; Should be IGNORE, not IGNORABLE; We're just silencing a compiler
+ ;; note.
(declare (ignorable standard))
(make-wired-tn (primitive-type-or-lose 'system-area-pointer *backend*)
sap-stack-sc-number return-pc-save-offset))
@@ -77,6 +79,8 @@
;;; No problems
;#+nil
(def-vm-support-routine make-old-fp-passing-location (standard)
+ ;; Should be IGNORE, not IGNORABLE; We're just silencing a compiler
+ ;; note.
(declare (ignorable standard))
(make-wired-tn *fixnum-primitive-type* control-stack-sc-number
ocfp-save-offset))
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/8e121dc54040d14dae5c663…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/8e121dc54040d14dae5c663…
You're receiving this email because of your account on gitlab.common-lisp.net.
Raymond Toy pushed to branch master at cmucl / cmucl
Commits:
aabe67a0 by Raymond Toy at 2024-07-25T13:16:53+00:00
Fix #340: Use +ascii-limit+ in srctran.lisp
- - - - -
8a2dbcb3 by Raymond Toy at 2024-07-25T13:16:57+00:00
Merge branch 'issue-340-srctran-use-ascii-limit' into 'master'
Fix #340: Use +ascii-limit+ in srctran.lisp
Closes #340 and #337
See merge request cmucl/cmucl!237
- - - - -
1 changed file:
- src/compiler/srctran.lisp
Changes:
=====================================
src/compiler/srctran.lisp
=====================================
@@ -3313,8 +3313,8 @@
#+(and unicode (not unicode-bootstrap))
'(let* ((ac (char-code a))
(bc (char-code b)))
- (if (and (<= ac #x7f)
- (<= bc #x7f))
+ (if (and (<= ac +ascii-limit+)
+ (<= bc +ascii-limit+))
;; ASCII
(let ((sum (logxor ac bc)))
(or (zerop sum)
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/5ad8c86eb3f7ad465f6033…
--
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/5ad8c86eb3f7ad465f6033…
You're receiving this email because of your account on gitlab.common-lisp.net.