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
6b4953fd
Commit
6b4953fd
authored
Aug 12, 2006
by
Neal Norwitz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check returned pointer is valid.
Klocwork #233
parent
b45f3518
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
2 deletions
+28
-2
Lib/test/regrtest.py
Lib/test/regrtest.py
+7
-0
Modules/_ctypes/cfield.c
Modules/_ctypes/cfield.c
+6
-0
Objects/funcobject.c
Objects/funcobject.c
+3
-2
Python/ceval.c
Python/ceval.c
+9
-0
Python/pythonrun.c
Python/pythonrun.c
+3
-0
No files found.
Lib/test/regrtest.py
View file @
6b4953fd
...
...
@@ -123,6 +123,7 @@ option '-uall,-bsddb'.
import
os
import
sys
import
signal
import
getopt
import
random
import
warnings
...
...
@@ -289,6 +290,12 @@ def main(tests=None, testdir=None, verbose=0, quiet=False, generate=False,
if
single
and
fromfile
:
usage
(
2
,
"-s and -f don't go together!"
)
def
handle_signal
(
*
args
):
raise
RuntimeError
(
'signal received %s'
%
args
)
# Provide a traceback if we are terminated.
signal
.
signal
(
signal
.
SIGTERM
,
handle_signal
)
good
=
[]
bad
=
[]
skipped
=
[]
...
...
Modules/_ctypes/cfield.c
View file @
6b4953fd
...
...
@@ -105,6 +105,12 @@ CField_FromDesc(PyObject *desc, int index,
StgDictObject
*
idict
;
if
(
adict
&&
adict
->
proto
)
{
idict
=
PyType_stgdict
(
adict
->
proto
);
if
(
!
idict
)
{
PyErr_SetString
(
PyExc_TypeError
,
"has no _stginfo_"
);
Py_DECREF
(
self
);
return
NULL
;
}
if
(
idict
->
getfunc
==
getentry
(
"c"
)
->
getfunc
)
{
struct
fielddesc
*
fd
=
getentry
(
"s"
);
getfunc
=
fd
->
getfunc
;
...
...
Objects/funcobject.c
View file @
6b4953fd
...
...
@@ -486,9 +486,10 @@ function_call(PyObject *func, PyObject *arg, PyObject *kw)
Py_ssize_t
nk
,
nd
;
argdefs
=
PyFunction_GET_DEFAULTS
(
func
);
/* XXX(nnorwitz): don't we know argdefs is either NULL or a tuple? */
if
(
argdefs
!=
NULL
&&
PyTuple_Check
(
argdefs
))
{
d
=
&
PyTuple_GET_ITEM
((
PyTupleObject
*
)
argdefs
,
0
);
nd
=
PyTuple_
Size
(
argdefs
);
nd
=
PyTuple_
GET_SIZE
(
argdefs
);
}
else
{
d
=
NULL
;
...
...
@@ -517,7 +518,7 @@ function_call(PyObject *func, PyObject *arg, PyObject *kw)
result
=
PyEval_EvalCodeEx
(
(
PyCodeObject
*
)
PyFunction_GET_CODE
(
func
),
PyFunction_GET_GLOBALS
(
func
),
(
PyObject
*
)
NULL
,
&
PyTuple_GET_ITEM
(
arg
,
0
),
PyTuple_
Size
(
arg
),
&
PyTuple_GET_ITEM
(
arg
,
0
),
PyTuple_
GET_SIZE
(
arg
),
k
,
nk
,
d
,
nd
,
PyFunction_GET_CLOSURE
(
func
));
...
...
Python/ceval.c
View file @
6b4953fd
...
...
@@ -229,6 +229,15 @@ PyEval_InitThreads(void)
main_thread
=
PyThread_get_thread_ident
();
}
void
_PyEval_FiniThreads
(
void
)
{
if
(
interpreter_lock
)
PyThread_free_lock
(
interpreter_lock
);
interpreter_lock
=
0
;
main_thread
=
0
;
}
void
PyEval_AcquireLock
(
void
)
{
...
...
Python/pythonrun.c
View file @
6b4953fd
...
...
@@ -60,6 +60,7 @@ static void call_sys_exitfunc(void);
static
void
call_ll_exitfuncs
(
void
);
extern
void
_PyUnicode_Init
(
void
);
extern
void
_PyUnicode_Fini
(
void
);
extern
void
_PyEval_FiniThreads
(
void
);
#ifdef WITH_THREAD
extern
void
_PyGILState_Init
(
PyInterpreterState
*
,
PyThreadState
*
);
...
...
@@ -461,6 +462,8 @@ Py_Finalize(void)
_PyUnicode_Fini
();
#endif
_PyEval_FiniThreads
();
/* XXX Still allocated:
- various static ad-hoc pointers to interned strings
- int and float free list blocks
...
...
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