Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
cmucl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Carl Shapiro
cmucl
Commits
2fecbda2
Commit
2fecbda2
authored
19 years ago
by
rtoy
Browse files
Options
Downloads
Patches
Plain Diff
Catch malformed (dotted) lists when reading vectors. (Are there other
cases we need to check for?) Fixes ansi-test syntax.dot-error.7.
parent
5461f11e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
code/sharpm.lisp
+27
-22
27 additions, 22 deletions
code/sharpm.lisp
with
27 additions
and
22 deletions
code/sharpm.lisp
+
27
−
22
View file @
2fecbda2
...
...
@@ -5,7 +5,7 @@
;;; Carnegie Mellon University, and has been placed in the public domain.
;;;
(
ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/sharpm.lisp,v 1.2
4
200
3
/0
3
/2
2 16:15:20 gerd
Exp $"
)
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/sharpm.lisp,v 1.2
5
200
5
/0
4
/2
8 20:32:10 rtoy
Exp $"
)
;;;
;;; **********************************************************************
;;;
...
...
@@ -46,27 +46,32 @@
(
defun
sharp-left-paren
(
stream
ignore
length
)
(
declare
(
ignore
ignore
)
(
special
*backquote-count*
))
(
let*
((
list
(
read-list
stream
nil
))
(
listlength
(
length
list
)))
(
declare
(
list
list
)
(
fixnum
listlength
))
(
cond
(
*read-suppress*
nil
)
((
zerop
*backquote-count*
)
(
if
length
(
cond
((
>
listlength
(
the
fixnum
length
))
(
%reader-error
stream
"Vector longer than specified length: #~S~S"
length
list
))
(
t
(
fill
(
the
simple-vector
(
replace
(
the
simple-vector
(
make-array
length
))
list
))
(
car
(
last
list
))
:start
listlength
)))
(
coerce
list
'vector
)))
(
t
(
cons
*bq-vector-flag*
list
)))))
(
let*
((
list
(
read-list
stream
nil
)))
;; Watch out for badly formed list (dotted list) and signal an
;; error if so. Do we need to check for other kinds of badly
;; formed lists?
(
when
(
cdr
(
last
list
))
(
%reader-error
stream
"Ill-formed vector: #~S"
list
))
(
let
((
listlength
(
length
list
)))
(
declare
(
list
list
)
(
fixnum
listlength
))
(
cond
(
*read-suppress*
nil
)
((
zerop
*backquote-count*
)
(
if
length
(
cond
((
>
listlength
(
the
fixnum
length
))
(
%reader-error
stream
"Vector longer than specified length: #~S~S"
length
list
))
(
t
(
fill
(
the
simple-vector
(
replace
(
the
simple-vector
(
make-array
length
))
list
))
(
car
(
last
list
))
:start
listlength
)))
(
coerce
list
'vector
)))
(
t
(
cons
*bq-vector-flag*
list
))))))
(
defun
sharp-star
(
stream
ignore
numarg
)
(
declare
(
ignore
ignore
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment