Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pyston
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
Boxiang Sun
Pyston
Commits
b679d358
Commit
b679d358
authored
Jan 08, 2015
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
That old check was silly and broken anyway; just use a blacklist now
parent
3b67736b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
19 deletions
+19
-19
src/capi/typeobject.cpp
src/capi/typeobject.cpp
+19
-19
No files found.
src/capi/typeobject.cpp
View file @
b679d358
...
@@ -1140,26 +1140,26 @@ extern "C" int PyType_Ready(PyTypeObject* cls) {
...
@@ -1140,26 +1140,26 @@ extern "C" int PyType_Ready(PyTypeObject* cls) {
RELEASE_ASSERT
(
cls
->
tp_setattr
==
NULL
,
""
);
RELEASE_ASSERT
(
cls
->
tp_setattr
==
NULL
,
""
);
RELEASE_ASSERT
(
cls
->
tp_compare
==
NULL
,
""
);
RELEASE_ASSERT
(
cls
->
tp_compare
==
NULL
,
""
);
// Hacky way to assert that only tp_as_number slots we support are getting set:
// zero out the ones we know about, then assert that the entire struct
// is zero, then restore the ones we know about.
if
(
cls
->
tp_as_number
)
{
if
(
cls
->
tp_as_number
)
{
#define SAVE(N) \
auto
num
=
cls
->
tp_as_number
;
auto N = cls->tp_as_number->N; \
// Members not added yet:
cls->tp_as_number->N = NULL;
assert
(
num
->
nb_coerce
==
NULL
);
#define RESTORE(N) cls->tp_as_number->N = N;
assert
(
num
->
nb_inplace_add
==
NULL
);
assert
(
num
->
nb_inplace_subtract
==
NULL
);
SAVE
(
nb_nonzero
);
assert
(
num
->
nb_inplace_multiply
==
NULL
);
SAVE
(
nb_add
);
assert
(
num
->
nb_inplace_divide
==
NULL
);
assert
(
num
->
nb_inplace_remainder
==
NULL
);
for
(
void
**
p
=
(
void
**
)
cls
->
tp_as_number
;
p
<
(
void
**
)(
cls
->
tp_as_number
+
1
);
p
++
)
{
assert
(
num
->
nb_inplace_power
==
NULL
);
// RELEASE_ASSERT(*p == NULL, "");
assert
(
num
->
nb_inplace_lshift
==
NULL
);
}
assert
(
num
->
nb_inplace_rshift
==
NULL
);
assert
(
num
->
nb_inplace_and
==
NULL
);
RESTORE
(
nb_nonzero
);
assert
(
num
->
nb_inplace_xor
==
NULL
);
RESTORE
(
nb_add
)
assert
(
num
->
nb_inplace_or
==
NULL
);
#undef SAVE
assert
(
num
->
nb_floor_divide
==
NULL
);
#undef RESTORE
assert
(
num
->
nb_true_divide
==
NULL
);
assert
(
num
->
nb_inplace_floor_divide
==
NULL
);
assert
(
num
->
nb_inplace_true_divide
==
NULL
);
assert
(
num
->
nb_index
==
NULL
);
}
}
RELEASE_ASSERT
(
cls
->
tp_getattro
==
NULL
||
cls
->
tp_getattro
==
PyObject_GenericGetAttr
,
""
);
RELEASE_ASSERT
(
cls
->
tp_getattro
==
NULL
||
cls
->
tp_getattro
==
PyObject_GenericGetAttr
,
""
);
...
...
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