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
a3f6d697
Commit
a3f6d697
authored
Mar 30, 2016
by
Marius Wachtler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix closure bugs
parent
e14f792a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
+8
-3
src/codegen/ast_interpreter.cpp
src/codegen/ast_interpreter.cpp
+5
-2
src/codegen/irgen/irgenerator.cpp
src/codegen/irgen/irgenerator.cpp
+3
-1
No files found.
src/codegen/ast_interpreter.cpp
View file @
a3f6d697
...
...
@@ -783,7 +783,7 @@ Box* ASTInterpreter::doOSR(AST_Jump* node) {
sorted_symbol_table
[
source_info
->
getInternedStrings
().
get
(
PASSED_GENERATOR_NAME
)]
=
generator
;
if
(
frame_info
.
passed_closure
)
sorted_symbol_table
[
source_info
->
getInternedStrings
().
get
(
PASSED_CLOSURE_NAME
)]
=
frame_info
.
passed_closure
;
sorted_symbol_table
[
source_info
->
getInternedStrings
().
get
(
PASSED_CLOSURE_NAME
)]
=
incref
(
frame_info
.
passed_closure
)
;
if
(
created_closure
)
sorted_symbol_table
[
source_info
->
getInternedStrings
().
get
(
CREATED_CLOSURE_NAME
)]
=
created_closure
;
...
...
@@ -1815,8 +1815,11 @@ void ASTInterpreterJitInterface::setLocalClosureHelper(void* _interpreter, long
assert
(
interpreter
->
getSymVRegMap
()[
id
]
==
vreg
);
Box
*
prev
=
interpreter
->
vregs
[
vreg
];
interpreter
->
vregs
[
vreg
]
=
v
;
interpreter
->
created_closure
->
elts
[
interpreter
->
scope_info
->
getClosureOffset
(
id
)]
=
incref
(
v
);
auto
closure_offset
=
interpreter
->
scope_info
->
getClosureOffset
(
id
);
Box
*
prev_closure_elt
=
interpreter
->
created_closure
->
elts
[
closure_offset
];
interpreter
->
created_closure
->
elts
[
closure_offset
]
=
incref
(
v
);
Py_XDECREF
(
prev
);
Py_XDECREF
(
prev_closure_elt
);
}
void
ASTInterpreterJitInterface
::
uncacheExcInfoHelper
(
void
*
_interpreter
)
{
...
...
src/codegen/irgen/irgenerator.cpp
View file @
a3f6d697
...
...
@@ -1311,8 +1311,10 @@ private:
llvm
::
BasicBlock
*
fail_bb
=
llvm
::
BasicBlock
::
Create
(
g
.
context
,
"deref_undefined"
,
irstate
->
getLLVMFunction
());
llvm
::
Constant
*
null_value
=
getNullPtr
(
g
.
llvm_value_type_ptr
);
emitter
.
setType
(
null_value
,
RefType
::
BORROWED
);
llvm
::
Value
*
check_val
=
emitter
.
getBuilder
()
->
CreateICmpEQ
(
lookupResult
,
getNullPtr
(
g
.
llvm_value_type_ptr
)
);
=
emitter
.
getBuilder
()
->
CreateICmpEQ
(
lookupResult
,
null_value
);
llvm
::
BranchInst
*
non_null_check
=
emitter
.
getBuilder
()
->
CreateCondBr
(
check_val
,
fail_bb
,
success_bb
);
// Case that it is undefined: call the assert fail function.
...
...
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