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
23b021d8
Commit
23b021d8
authored
Jan 22, 2016
by
Marius Wachtler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow changing the name of types which have a different metaclass than type
parent
589e6a68
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
3 deletions
+9
-3
src/codegen/baseline_jit.cpp
src/codegen/baseline_jit.cpp
+1
-1
src/runtime/ics.cpp
src/runtime/ics.cpp
+1
-1
src/runtime/types.cpp
src/runtime/types.cpp
+1
-1
test/tests/class_and_func_name.py
test/tests/class_and_func_name.py
+6
-0
No files found.
src/codegen/baseline_jit.cpp
View file @
23b021d8
...
...
@@ -84,7 +84,7 @@ JitCodeBlock::JitCodeBlock(llvm::StringRef name)
int32_t
*
offset_ptr
=
(
int32_t
*
)((
uint8_t
*
)
eh_frame_addr
+
0x20
);
int32_t
*
size_ptr
=
(
int32_t
*
)((
uint8_t
*
)
eh_frame_addr
+
0x24
);
int64_t
offset
=
(
int8_t
*
)
code
.
get
()
-
(
int8_t
*
)
offset_ptr
;
assert
(
offset
>=
INT_MIN
&&
offset
<=
INT_MAX
);
RELEASE_ASSERT
(
offset
>=
INT_MIN
&&
offset
<=
INT_MAX
,
""
);
*
offset_ptr
=
offset
;
*
size_ptr
=
code_size
;
...
...
src/runtime/ics.cpp
View file @
23b021d8
...
...
@@ -168,7 +168,7 @@ static void writeTrivialEhFrame(void* eh_frame_addr, void* func_addr, uint64_t f
int32_t
*
size_ptr
=
(
int32_t
*
)((
uint8_t
*
)
eh_frame_addr
+
0x24
);
int64_t
offset
=
(
int8_t
*
)
func_addr
-
(
int8_t
*
)
offset_ptr
;
assert
(
offset
>=
INT_MIN
&&
offset
<=
INT_MAX
);
RELEASE_ASSERT
(
offset
>=
INT_MIN
&&
offset
<=
INT_MAX
,
""
);
*
offset_ptr
=
offset
;
assert
(
func_size
<=
UINT_MAX
);
...
...
src/runtime/types.cpp
View file @
23b021d8
...
...
@@ -3251,7 +3251,7 @@ static Box* typeName(Box* b, void*) {
}
static
void
typeSetName
(
Box
*
b
,
Box
*
v
,
void
*
)
{
assert
(
b
->
cls
==
type_cls
);
assert
(
PyType_Check
(
b
)
);
BoxedClass
*
type
=
static_cast
<
BoxedClass
*>
(
b
);
// Awkward... in CPython you can only set __name__ for heaptype classes
...
...
test/tests/class_and_func_name.py
View file @
23b021d8
...
...
@@ -54,3 +54,9 @@ print sorted.__name__
# should all fail:
set_name
(
sorted
,
"blah"
)
set_name
(
sorted
,
5
)
import
abc
class
D
(
C
):
__metaclass__
=
abc
.
ABCMeta
D
.
__name__
=
"has_abc_meta"
print
D
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