Raymond Toy pushed to branch issue-457-delete-directory-signals-errors at cmucl / cmucl
Commits:
-
e2b4641a
by Raymond Toy at 2025-12-13T14:24:22-08:00
-
16097f45
by Raymond Toy at 2025-12-13T14:24:22-08:00
-
f146f87f
by Raymond Toy at 2025-12-13T15:11:21-08:00
-
50d2569d
by Raymond Toy at 2025-12-14T08:27:27-08:00
-
3099b050
by Raymond Toy at 2025-12-14T12:29:22-08:00
7 changed files:
- src/code/exports.lisp
- src/code/extensions.lisp
- src/compiler/float-tran-dd.lisp
- src/general-info/release-22a.md
- src/i18n/locale/cmucl.pot
- tests/float.lisp
- tests/pathname.lisp
Changes:
| ... | ... | @@ -1214,7 +1214,7 @@ |
| 1214 | 1214 | "INVALID-FASL"
|
| 1215 | 1215 | "WITH-TEMPORARY-DIRECTORY"
|
| 1216 | 1216 | "WITH-TEMPORARY-FILE"
|
| 1217 | - "DELETE-DIRETORY")
|
|
| 1217 | + "DELETE-DIRECTORY")
|
|
| 1218 | 1218 | ;; gencgc features
|
| 1219 | 1219 | #+gencgc
|
| 1220 | 1220 | (:export "GET-GC-ASSERTIONS"
|
| ... | ... | @@ -673,8 +673,9 @@ |
| 673 | 673 | (defun delete-directory (dirname &key recursive)
|
| 674 | 674 | _N"Delete the directory Dirname. If the Recursive is non-NIL,
|
| 675 | 675 | recursively delete the directory Dirname including all files and
|
| 676 | - subdirectories. Dirname must be a pathname to a directory. Any NAME
|
|
| 677 | - or TYPE components in Dirname are ignored."
|
|
| 676 | + subdirectories. Dirname must name a directory. Any NAME or TYPE
|
|
| 677 | + components in Dirname are ignored. A FILE-ERROR is signaled if any
|
|
| 678 | + directory cannot be deleted."
|
|
| 678 | 679 | (when recursive
|
| 679 | 680 | ;; Find all the files or directories in DIRNAME.
|
| 680 | 681 | (dolist (path (directory (merge-pathnames "*.*" dirname)))
|
| ... | ... | @@ -290,10 +290,10 @@ |
| 290 | 290 | (optimize (speed 3)))
|
| 291 | 291 | ;; If the numbers are too big, scale them done so SPLIT doesn't overflow.
|
| 292 | 292 | (multiple-value-bind (aa bb)
|
| 293 | - (values (if (> a +two970+)
|
|
| 293 | + (values (if (> (abs a) +two970+)
|
|
| 294 | 294 | (* a +two-53+)
|
| 295 | 295 | a)
|
| 296 | - (if (> b +two970+)
|
|
| 296 | + (if (> (abs b) +two970+)
|
|
| 297 | 297 | (* b +two-53+)
|
| 298 | 298 | b))
|
| 299 | 299 | (let ((p (* aa bb)))
|
| ... | ... | @@ -314,10 +314,10 @@ |
| 314 | 314 | (declare (optimize (inhibit-warnings 3)))
|
| 315 | 315 | ;; If the numbers was scaled down, we need to scale the
|
| 316 | 316 | ;; result back up.
|
| 317 | - (when (> a +two970+)
|
|
| 317 | + (when (> (abs a) +two970+)
|
|
| 318 | 318 | (setf p (* p +two53+)
|
| 319 | 319 | e (* e +two53+)))
|
| 320 | - (when (> b +two970+)
|
|
| 320 | + (when (> (abs b) +two970+)
|
|
| 321 | 321 | (setf p (* p +two53+)
|
| 322 | 322 | e (* e +two53+)))
|
| 323 | 323 | (values p e))))))))
|
| ... | ... | @@ -34,6 +34,7 @@ public domain. |
| 34 | 34 | * #446: Use C compiler to get errno values to update UNIX
|
| 35 | 35 | defpackage with errno symbols
|
| 36 | 36 | * #453: Use correct flags for analyzer and always save logs.
|
| 37 | + * #458: Spurious overflow in double-double-float multiply
|
|
| 37 | 38 | * Other changes:
|
| 38 | 39 | * Improvements to the PCL implementation of CLOS:
|
| 39 | 40 | * Changes to building procedure:
|
| ... | ... | @@ -6011,8 +6011,9 @@ msgstr "" |
| 6011 | 6011 | msgid ""
|
| 6012 | 6012 | "Delete the directory Dirname. If the Recursive is non-NIL,\n"
|
| 6013 | 6013 | " recursively delete the directory Dirname including all files and\n"
|
| 6014 | -" subdirectories. Dirname must be a pathname to a directory. Any NAME\n"
|
|
| 6015 | -" or TYPE components in Dirname are ignored."
|
|
| 6014 | +" subdirectories. Dirname must name a directory. Any NAME or TYPE\n"
|
|
| 6015 | +" components in Dirname are ignored. A FILE-ERROR is signaled if any\n"
|
|
| 6016 | +" directory cannot be deleted."
|
|
| 6016 | 6017 | msgstr ""
|
| 6017 | 6018 | |
| 6018 | 6019 | #: src/code/extensions.lisp
|
| ... | ... | @@ -342,3 +342,11 @@ |
| 342 | 342 | (x86::x87-floating-point-modes)))))
|
| 343 | 343 | (assert-true (typep new-mode 'x86::float-modes))
|
| 344 | 344 | (assert-equal new-mode (setf (x86::x87-floating-point-modes) new-mode))))
|
| 345 | + |
|
| 346 | + |
|
| 347 | + |
|
| 348 | +;; Issue #458
|
|
| 349 | +(define-test dd-mult-overflow
|
|
| 350 | + (:tag :issues)
|
|
| 351 | + (assert-equal -2w300
|
|
| 352 | + (* -2w300 1w0))) |
| ... | ... | @@ -144,13 +144,13 @@ |
| 144 | 144 | (assert-equal dir-tilde dir-home))))
|
| 145 | 145 | |
| 146 | 146 | (define-test delete-directory
|
| 147 | - (let ((dir (ensure-directories-exist "tmp/a/b/c/")))
|
|
| 148 | - ;; Verify that the directories were created.
|
|
| 149 | - (assert-equal "tmp/a/b/c/"
|
|
| 150 | - dir)
|
|
| 151 | - ;; Try to delete the directory. It should fail..
|
|
| 152 | - (assert-error 'kernel:simple-file-error
|
|
| 153 | - (ext:delete-directory (pathname "tmp/")))
|
|
| 154 | - ;; Now recursively delete the directory.
|
|
| 155 | - (assert-true (ext:delete-directory (pathname "tmp/") :recursive t))
|
|
| 156 | - (assert-false (directory "tmp/")))) |
|
| 147 | + (:tag :issues)
|
|
| 148 | + (ext:with-temporary-directory (path)
|
|
| 149 | + (let ((dir (ensure-directories-exist (merge-pathnames "tmp/a/b/c/" path))))
|
|
| 150 | + ;; Try to delete the directory. It should fail..
|
|
| 151 | + (assert-error 'kernel:simple-file-error
|
|
| 152 | + (ext:delete-directory (merge-pathnames "tmp/" path)))
|
|
| 153 | + ;; Now recursively delete the directory.
|
|
| 154 | + (assert-true (ext:delete-directory (merge-pathnames "tmp/" path)
|
|
| 155 | + :recursive t))
|
|
| 156 | + (assert-false (directory "tmp/"))))) |