Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
c988ae01
Commit
c988ae01
authored
Sep 07, 2017
by
Benjamin Peterson
Committed by
GitHub
Sep 07, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove current_filename optimization from marshal (#3423) (closes bpo-31384)
parent
a6a4dc81
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
19 deletions
+0
-19
Python/marshal.c
Python/marshal.c
+0
-19
No files found.
Python/marshal.c
View file @
c988ae01
...
...
@@ -647,7 +647,6 @@ typedef struct {
FILE
*
fp
;
int
depth
;
PyObject
*
readable
;
/* Stream-like object being read from */
PyObject
*
current_filename
;
char
*
ptr
;
char
*
end
;
char
*
buf
;
...
...
@@ -1390,18 +1389,6 @@ r_object(RFILE *p)
filename
=
r_object
(
p
);
if
(
filename
==
NULL
)
goto
code_error
;
if
(
PyUnicode_CheckExact
(
filename
))
{
if
(
p
->
current_filename
!=
NULL
)
{
if
(
!
PyUnicode_Compare
(
filename
,
p
->
current_filename
))
{
Py_DECREF
(
filename
);
Py_INCREF
(
p
->
current_filename
);
filename
=
p
->
current_filename
;
}
}
else
{
p
->
current_filename
=
filename
;
}
}
name
=
r_object
(
p
);
if
(
name
==
NULL
)
goto
code_error
;
...
...
@@ -1484,7 +1471,6 @@ PyMarshal_ReadShortFromFile(FILE *fp)
assert
(
fp
);
rf
.
readable
=
NULL
;
rf
.
fp
=
fp
;
rf
.
current_filename
=
NULL
;
rf
.
end
=
rf
.
ptr
=
NULL
;
rf
.
buf
=
NULL
;
res
=
r_short
(
&
rf
);
...
...
@@ -1500,7 +1486,6 @@ PyMarshal_ReadLongFromFile(FILE *fp)
long
res
;
rf
.
fp
=
fp
;
rf
.
readable
=
NULL
;
rf
.
current_filename
=
NULL
;
rf
.
ptr
=
rf
.
end
=
NULL
;
rf
.
buf
=
NULL
;
res
=
r_long
(
&
rf
);
...
...
@@ -1562,7 +1547,6 @@ PyMarshal_ReadObjectFromFile(FILE *fp)
PyObject
*
result
;
rf
.
fp
=
fp
;
rf
.
readable
=
NULL
;
rf
.
current_filename
=
NULL
;
rf
.
depth
=
0
;
rf
.
ptr
=
rf
.
end
=
NULL
;
rf
.
buf
=
NULL
;
...
...
@@ -1583,7 +1567,6 @@ PyMarshal_ReadObjectFromString(const char *str, Py_ssize_t len)
PyObject
*
result
;
rf
.
fp
=
NULL
;
rf
.
readable
=
NULL
;
rf
.
current_filename
=
NULL
;
rf
.
ptr
=
(
char
*
)
str
;
rf
.
end
=
(
char
*
)
str
+
len
;
rf
.
buf
=
NULL
;
...
...
@@ -1723,7 +1706,6 @@ marshal_load(PyObject *module, PyObject *file)
rf
.
depth
=
0
;
rf
.
fp
=
NULL
;
rf
.
readable
=
file
;
rf
.
current_filename
=
NULL
;
rf
.
ptr
=
rf
.
end
=
NULL
;
rf
.
buf
=
NULL
;
if
((
rf
.
refs
=
PyList_New
(
0
))
!=
NULL
)
{
...
...
@@ -1782,7 +1764,6 @@ marshal_loads_impl(PyObject *module, Py_buffer *bytes)
PyObject
*
result
;
rf
.
fp
=
NULL
;
rf
.
readable
=
NULL
;
rf
.
current_filename
=
NULL
;
rf
.
ptr
=
s
;
rf
.
end
=
s
+
n
;
rf
.
depth
=
0
;
...
...
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