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
d4802e1b
Commit
d4802e1b
authored
Jun 08, 2014
by
Kevin Modzelewski
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #81 from undingen/iterator_invalid
Remove read from freed memory
parents
d750c9eb
867eef3d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
src/core/ast.h
src/core/ast.h
+4
-1
src/core/cfg.cpp
src/core/cfg.cpp
+4
-1
No files found.
src/core/ast.h
View file @
d4802e1b
...
@@ -808,7 +808,10 @@ public:
...
@@ -808,7 +808,10 @@ public:
virtual
void
accept
(
ASTVisitor
*
v
);
virtual
void
accept
(
ASTVisitor
*
v
);
virtual
void
accept_stmt
(
StmtVisitor
*
v
);
virtual
void
accept_stmt
(
StmtVisitor
*
v
);
AST_Jump
()
:
AST_stmt
(
AST_TYPE
::
Jump
)
{}
AST_Jump
()
:
AST_stmt
(
AST_TYPE
::
Jump
)
{
lineno
=
-
1
;
col_offset
=
-
1
;
}
static
const
AST_TYPE
::
AST_TYPE
TYPE
=
AST_TYPE
::
Jump
;
static
const
AST_TYPE
::
AST_TYPE
TYPE
=
AST_TYPE
::
Jump
;
};
};
...
...
src/core/cfg.cpp
View file @
d4802e1b
...
@@ -1654,7 +1654,10 @@ CFG* computeCFG(AST_TYPE::AST_TYPE root_type, std::vector<AST_stmt*> body) {
...
@@ -1654,7 +1654,10 @@ CFG* computeCFG(AST_TYPE::AST_TYPE root_type, std::vector<AST_stmt*> body) {
// and can make the analyses more efficient.
// and can make the analyses more efficient.
// The extra blocks would get merged by LLVM passes, so I'm not sure
// The extra blocks would get merged by LLVM passes, so I'm not sure
// how much overall improvement there is.
// how much overall improvement there is.
for
(
CFGBlock
*
b
:
rtn
->
blocks
)
{
// Must evaluate end() on every iteration because erase() will invalidate the end.
for
(
auto
it
=
rtn
->
blocks
.
begin
();
it
!=
rtn
->
blocks
.
end
();
++
it
)
{
CFGBlock
*
b
=
*
it
;
while
(
b
->
successors
.
size
()
==
1
)
{
while
(
b
->
successors
.
size
()
==
1
)
{
CFGBlock
*
b2
=
b
->
successors
[
0
];
CFGBlock
*
b2
=
b
->
successors
[
0
];
if
(
b2
->
predecessors
.
size
()
!=
1
)
if
(
b2
->
predecessors
.
size
()
!=
1
)
...
...
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