Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
c0c1ee9f
Commit
c0c1ee9f
authored
Jun 18, 2011
by
Paul Eggert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
parent
a498d7f4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
src/ChangeLog
src/ChangeLog
+2
-0
src/alloc.c
src/alloc.c
+7
-5
No files found.
src/ChangeLog
View file @
c0c1ee9f
2011-06-18 Paul Eggert <eggert@cs.ucla.edu>
* alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
* fns.c (concat): Catch string overflow earlier.
Do not rely on integer wraparound.
...
...
src/alloc.c
View file @
c0c1ee9f
...
...
@@ -2257,12 +2257,14 @@ LENGTH must be a number. INIT matters only in whether it is t or nil. */)
p
=
XBOOL_VECTOR
(
val
);
p
->
size
=
XFASTINT
(
length
);
memset
(
p
->
data
,
NILP
(
init
)
?
0
:
-
1
,
length_in_chars
);
if
(
length_in_chars
)
{
memset
(
p
->
data
,
!
NILP
(
init
)
?
-
1
:
0
,
length_in_chars
);
/* Clear
the
extraneous bits in the last byte. */
if
(
XINT
(
length
)
!=
length_in_chars
*
BOOL_VECTOR_BITS_PER_CHAR
)
p
->
data
[
length_in_chars
-
1
]
&=
(
1
<<
(
XINT
(
length
)
%
BOOL_VECTOR_BITS_PER_CHAR
))
-
1
;
/* Clear
any
extraneous bits in the last byte. */
p
->
data
[
length_in_chars
-
1
]
&=
(
1
<<
(
XINT
(
length
)
%
BOOL_VECTOR_BITS_PER_CHAR
))
-
1
;
}
return
val
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment