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
0545a7d1
Commit
0545a7d1
authored
Feb 26, 2016
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix the merge
parent
5e6f5956
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
21 deletions
+20
-21
from_cpython/Objects/fileobject.c
from_cpython/Objects/fileobject.c
+2
-0
src/codegen/irgen/irgenerator.cpp
src/codegen/irgen/irgenerator.cpp
+2
-2
src/runtime/objmodel.cpp
src/runtime/objmodel.cpp
+10
-9
src/runtime/types.cpp
src/runtime/types.cpp
+6
-10
No files found.
from_cpython/Objects/fileobject.c
View file @
0545a7d1
...
@@ -2358,6 +2358,8 @@ file_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
...
@@ -2358,6 +2358,8 @@ file_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
if
(
not_yet_string
==
NULL
)
{
if
(
not_yet_string
==
NULL
)
{
not_yet_string
=
PyString_InternFromString
(
"<uninitialized file>"
);
not_yet_string
=
PyString_InternFromString
(
"<uninitialized file>"
);
// Pyston change:
PyGC_RegisterStaticConstant
(
not_yet_string
);
if
(
not_yet_string
==
NULL
)
if
(
not_yet_string
==
NULL
)
return
NULL
;
return
NULL
;
}
}
...
...
src/codegen/irgen/irgenerator.cpp
View file @
0545a7d1
...
@@ -2132,8 +2132,8 @@ private:
...
@@ -2132,8 +2132,8 @@ private:
auto
d
=
evalExpr
(
node
->
dest
,
unw_info
);
auto
d
=
evalExpr
(
node
->
dest
,
unw_info
);
dest
=
d
->
makeConverted
(
emitter
,
d
->
getBoxType
());
dest
=
d
->
makeConverted
(
emitter
,
d
->
getBoxType
());
}
else
{
}
else
{
dest
=
new
ConcreteCompilerVariable
(
dest
=
new
ConcreteCompilerVariable
(
UNKNOWN
,
UNKNOWN
,
emitter
.
setType
(
getNullPtr
(
g
.
llvm_value_type_ptr
),
RefType
::
BORROWED
),
true
);
emitter
.
setType
(
getNullPtr
(
g
.
llvm_value_type_ptr
),
RefType
::
BORROWED
)
);
}
}
assert
(
dest
);
assert
(
dest
);
...
...
src/runtime/objmodel.cpp
View file @
0545a7d1
...
@@ -147,14 +147,19 @@ extern "C" void printHelper(Box* w, Box* v, bool nl) {
...
@@ -147,14 +147,19 @@ extern "C" void printHelper(Box* w, Box* v, bool nl) {
raiseExcHelper
(
RuntimeError
,
"lost sys.stdout"
);
raiseExcHelper
(
RuntimeError
,
"lost sys.stdout"
);
}
}
// CPython comments:
/* PyFile_SoftSpace() can exececute arbitrary code
if sys.stdout is an instance with a __getattr__.
If __getattr__ raises an exception, w will
be freed, so we need to prevent that temporarily. */
/* w.write() may replace sys.stdout, so we
* have to keep our reference to it */
Py_INCREF
(
w
);
AUTO_DECREF
(
w
);
int
err
=
0
;
int
err
=
0
;
if
(
v
)
{
if
(
v
)
{
/* PyFile_SoftSpace() can exececute arbitrary code
if sys.stdout is an instance with a __getattr__.
If __getattr__ raises an exception, w will
be freed, so we need to prevent that temporarily. */
Py_XINCREF
(
w
);
if
(
w
!=
NULL
&&
PyFile_SoftSpace
(
w
,
0
))
if
(
w
!=
NULL
&&
PyFile_SoftSpace
(
w
,
0
))
err
=
PyFile_WriteString
(
" "
,
w
);
err
=
PyFile_WriteString
(
" "
,
w
);
if
(
err
==
0
)
if
(
err
==
0
)
...
@@ -182,13 +187,9 @@ extern "C" void printHelper(Box* w, Box* v, bool nl) {
...
@@ -182,13 +187,9 @@ extern "C" void printHelper(Box* w, Box* v, bool nl) {
if
(
nl
)
{
if
(
nl
)
{
if
(
w
!=
NULL
)
{
if
(
w
!=
NULL
)
{
/* w.write() may replace sys.stdout, so we
* have to keep our reference to it */
Py_INCREF
(
w
);
err
=
PyFile_WriteString
(
"
\n
"
,
w
);
err
=
PyFile_WriteString
(
"
\n
"
,
w
);
if
(
err
==
0
)
if
(
err
==
0
)
PyFile_SoftSpace
(
w
,
0
);
PyFile_SoftSpace
(
w
,
0
);
Py_DECREF
(
w
);
}
}
// Py_XDECREF(stream);
// Py_XDECREF(stream);
}
}
...
...
src/runtime/types.cpp
View file @
0545a7d1
...
@@ -3382,7 +3382,6 @@ static Box* getsetDelete(Box* self, Box* obj) {
...
@@ -3382,7 +3382,6 @@ static Box* getsetDelete(Box* self, Box* obj) {
return
getsetSet
(
self
,
obj
,
NULL
);
return
getsetSet
(
self
,
obj
,
NULL
);
}
}
<<<<<<<
HEAD
void
Box
::
clearAttrs
()
{
void
Box
::
clearAttrs
()
{
if
(
cls
->
instancesHaveHCAttrs
())
{
if
(
cls
->
instancesHaveHCAttrs
())
{
HCAttrs
*
attrs
=
getHCAttrsPtr
();
HCAttrs
*
attrs
=
getHCAttrsPtr
();
...
@@ -3744,14 +3743,11 @@ extern "C" PyObject* PyGC_RegisterStaticConstant(Box* b) noexcept {
...
@@ -3744,14 +3743,11 @@ extern "C" PyObject* PyGC_RegisterStaticConstant(Box* b) noexcept {
extern
"C"
void
_PyUnicode_Fini
(
void
);
extern
"C"
void
_PyUnicode_Fini
(
void
);
|||||||
merged
common
ancestors
=======
static
int
_check_and_flush
(
FILE
*
stream
)
{
static
int
_check_and_flush
(
FILE
*
stream
)
{
int
prev_fail
=
ferror
(
stream
);
int
prev_fail
=
ferror
(
stream
);
return
fflush
(
stream
)
||
prev_fail
?
EOF
:
0
;
return
fflush
(
stream
)
||
prev_fail
?
EOF
:
0
;
}
}
>>>>>>>
1
f4a1b
bool
TRACK_ALLOCATIONS
=
false
;
bool
TRACK_ALLOCATIONS
=
false
;
void
setupRuntime
()
{
void
setupRuntime
()
{
root_hcls
=
HiddenClass
::
makeRoot
();
root_hcls
=
HiddenClass
::
makeRoot
();
...
@@ -4248,12 +4244,12 @@ void setupRuntime() {
...
@@ -4248,12 +4244,12 @@ void setupRuntime() {
syserr
=
PyFile_FromFile
(
stderr
,
"<stderr>"
,
"w"
,
_check_and_flush
);
syserr
=
PyFile_FromFile
(
stderr
,
"<stderr>"
,
"w"
,
_check_and_flush
);
RELEASE_ASSERT
(
!
PyErr_Occurred
(),
""
);
RELEASE_ASSERT
(
!
PyErr_Occurred
(),
""
);
sys_module
->
giveAttr
(
"stdout"
,
sysout
);
sys_module
->
giveAttr
Borrowed
(
"stdout"
,
sysout
);
sys_module
->
giveAttr
(
"stdin"
,
sysin
);
sys_module
->
giveAttr
Borrowed
(
"stdin"
,
sysin
);
sys_module
->
giveAttr
(
"stderr"
,
syserr
);
sys_module
->
giveAttr
Borrowed
(
"stderr"
,
syserr
);
sys_module
->
giveAttr
(
"__stdout__"
,
sys
_module
->
getattr
(
internStringMortal
(
"stdout"
))
);
sys_module
->
giveAttr
(
"__stdout__"
,
sys
out
);
sys_module
->
giveAttr
(
"__stdin__"
,
sys
_module
->
getattr
(
internStringMortal
(
"stdin"
))
);
sys_module
->
giveAttr
(
"__stdin__"
,
sys
in
);
sys_module
->
giveAttr
(
"__stderr__"
,
sys
_module
->
getattr
(
internStringMortal
(
"stderr"
))
);
sys_module
->
giveAttr
(
"__stderr__"
,
sys
err
);
setupBuiltins
();
setupBuiltins
();
...
...
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