Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jadx
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open-source
jadx
Commits
79114520
Commit
79114520
authored
Mar 23, 2013
by
Skylot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix endless loop in path existence check
parent
d3c2496f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
10 deletions
+16
-10
BlockUtils.java
src/main/java/jadx/utils/BlockUtils.java
+16
-10
No files found.
src/main/java/jadx/utils/BlockUtils.java
View file @
79114520
...
...
@@ -70,7 +70,7 @@ public class BlockUtils {
}
/**
* Check if insn contains in block (use == for comparison, not equals)
* Check if ins
tructio
n contains in block (use == for comparison, not equals)
*/
public
static
boolean
blockContains
(
BlockNode
block
,
InsnNode
insn
)
{
for
(
InsnNode
bi
:
block
.
getInstructions
())
{
...
...
@@ -81,7 +81,7 @@ public class BlockUtils {
}
/**
* Return
position of instruc
tion in block (use == for comparison, not equals)
* Return
instruction posi
tion in block (use == for comparison, not equals)
*/
public
static
int
insnIndex
(
BlockNode
block
,
InsnNode
insn
)
{
int
size
=
block
.
getInstructions
().
size
();
...
...
@@ -128,7 +128,7 @@ public class BlockUtils {
}
/**
* Return first successor which not exception handler
or followed by
loop back edge
* Return first successor which not exception handler
and not follow
loop back edge
*/
public
static
BlockNode
getNextBlock
(
BlockNode
block
)
{
List
<
BlockNode
>
s
=
block
.
getCleanSuccessors
();
...
...
@@ -155,13 +155,20 @@ public class BlockUtils {
}
}
private
static
boolean
addSuccessorsUntil
(
BlockNode
from
,
BlockNode
until
)
{
if
(
from
==
until
)
private
static
boolean
traverseSuccessorsUntil
(
BlockNode
from
,
BlockNode
until
,
Set
<
BlockNode
>
checked
)
{
for
(
BlockNode
s
:
from
.
getCleanSuccessors
())
{
if
(
s
==
until
)
return
true
;
for
(
BlockNode
s
:
from
.
getCleanSuccessors
())
{
if
(
addSuccessorsUntil
(
s
,
until
))
if
(!
checked
.
contains
(
s
))
{
checked
.
add
(
s
);
if
(
until
.
isDominator
(
s
))
return
true
;
if
(
traverseSuccessorsUntil
(
s
,
until
,
checked
))
return
true
;
}
}
return
false
;
}
...
...
@@ -173,8 +180,7 @@ public class BlockUtils {
if
(
end
.
isDominator
(
start
))
return
true
;
return
addSuccessorsUntil
(
start
,
end
);
// return addPredcessorsUntil(new HashSet<BlockNode>(), end, start);
return
traverseSuccessorsUntil
(
start
,
end
,
new
HashSet
<
BlockNode
>());
}
/**
...
...
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