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
d2811263
Commit
d2811263
authored
Sep 27, 2014
by
Skylot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core: fix processing try/catch in loop
parent
4fb6ada5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
4 deletions
+16
-4
LoopRegion.java
...src/main/java/jadx/core/dex/regions/loops/LoopRegion.java
+8
-3
ProcessTryCatchRegions.java
...adx/core/dex/visitors/regions/ProcessTryCatchRegions.java
+8
-1
No files found.
jadx-core/src/main/java/jadx/core/dex/regions/loops/LoopRegion.java
View file @
d2811263
...
@@ -20,7 +20,7 @@ public final class LoopRegion extends AbstractRegion {
...
@@ -20,7 +20,7 @@ public final class LoopRegion extends AbstractRegion {
private
final
BlockNode
conditionBlock
;
private
final
BlockNode
conditionBlock
;
// instruction which must be executed before condition in every loop
// instruction which must be executed before condition in every loop
private
BlockNode
preCondition
;
private
BlockNode
preCondition
;
private
I
Container
body
;
private
I
Region
body
;
private
final
boolean
conditionAtEnd
;
private
final
boolean
conditionAtEnd
;
private
LoopType
type
;
private
LoopType
type
;
...
@@ -44,11 +44,11 @@ public final class LoopRegion extends AbstractRegion {
...
@@ -44,11 +44,11 @@ public final class LoopRegion extends AbstractRegion {
return
conditionBlock
;
return
conditionBlock
;
}
}
public
I
Container
getBody
()
{
public
I
Region
getBody
()
{
return
body
;
return
body
;
}
}
public
void
setBody
(
I
Container
body
)
{
public
void
setBody
(
I
Region
body
)
{
this
.
body
=
body
;
this
.
body
=
body
;
}
}
...
@@ -145,6 +145,11 @@ public final class LoopRegion extends AbstractRegion {
...
@@ -145,6 +145,11 @@ public final class LoopRegion extends AbstractRegion {
}
}
@Override
@Override
public
boolean
replaceSubBlock
(
IContainer
oldBlock
,
IContainer
newBlock
)
{
return
false
;
}
@Override
public
String
baseString
()
{
public
String
baseString
()
{
return
body
.
baseString
();
return
body
.
baseString
();
}
}
...
...
jadx-core/src/main/java/jadx/core/dex/visitors/regions/ProcessTryCatchRegions.java
View file @
d2811263
...
@@ -7,6 +7,7 @@ import jadx.core.dex.nodes.IRegion;
...
@@ -7,6 +7,7 @@ import jadx.core.dex.nodes.IRegion;
import
jadx.core.dex.nodes.MethodNode
;
import
jadx.core.dex.nodes.MethodNode
;
import
jadx.core.dex.regions.AbstractRegion
;
import
jadx.core.dex.regions.AbstractRegion
;
import
jadx.core.dex.regions.Region
;
import
jadx.core.dex.regions.Region
;
import
jadx.core.dex.regions.loops.LoopRegion
;
import
jadx.core.dex.trycatch.CatchAttr
;
import
jadx.core.dex.trycatch.CatchAttr
;
import
jadx.core.dex.trycatch.ExceptionHandler
;
import
jadx.core.dex.trycatch.ExceptionHandler
;
import
jadx.core.dex.trycatch.TryCatchBlock
;
import
jadx.core.dex.trycatch.TryCatchBlock
;
...
@@ -121,7 +122,13 @@ public class ProcessTryCatchRegions extends AbstractRegionVisitor {
...
@@ -121,7 +122,13 @@ public class ProcessTryCatchRegions extends AbstractRegionVisitor {
/**
/**
* Extract all block dominated by 'dominator' to separate region and mark as try/catch block
* Extract all block dominated by 'dominator' to separate region and mark as try/catch block
*/
*/
private
static
boolean
wrapBlocks
(
IRegion
region
,
TryCatchBlock
tb
,
BlockNode
dominator
)
{
private
static
boolean
wrapBlocks
(
IRegion
replaceRegion
,
TryCatchBlock
tb
,
BlockNode
dominator
)
{
IRegion
region
=
replaceRegion
;
if
(
region
instanceof
LoopRegion
)
{
LoopRegion
loop
=
(
LoopRegion
)
region
;
region
=
loop
.
getBody
();
}
Region
newRegion
=
new
Region
(
region
);
Region
newRegion
=
new
Region
(
region
);
List
<
IContainer
>
subBlocks
=
region
.
getSubBlocks
();
List
<
IContainer
>
subBlocks
=
region
.
getSubBlocks
();
for
(
IContainer
cont
:
subBlocks
)
{
for
(
IContainer
cont
:
subBlocks
)
{
...
...
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