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
60615d01
Commit
60615d01
authored
Jun 15, 2013
by
Skylot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix issue for wraped synchronized argument
parent
cb6ff606
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
12 deletions
+11
-12
RegionGen.java
src/main/java/jadx/codegen/RegionGen.java
+1
-1
SynchronizedRegion.java
src/main/java/jadx/dex/regions/SynchronizedRegion.java
+6
-6
RegionMaker.java
src/main/java/jadx/dex/visitors/regions/RegionMaker.java
+4
-5
No files found.
src/main/java/jadx/codegen/RegionGen.java
View file @
60615d01
...
...
@@ -152,7 +152,7 @@ public class RegionGen extends InsnGen {
}
private
void
makeSynchronizedRegion
(
SynchronizedRegion
cont
,
CodeWriter
code
)
throws
CodegenException
{
code
.
startLine
(
"synchronized("
).
add
(
arg
(
cont
.
get
Arg
(
))).
add
(
") {"
);
code
.
startLine
(
"synchronized("
).
add
(
arg
(
cont
.
get
Insn
().
getArg
(
0
))).
add
(
") {"
);
makeRegionIndent
(
code
,
cont
.
getRegion
());
code
.
startLine
(
'}'
);
}
...
...
src/main/java/jadx/dex/regions/SynchronizedRegion.java
View file @
60615d01
package
jadx
.
dex
.
regions
;
import
jadx.dex.instructions.args.RegisterArg
;
import
jadx.dex.nodes.IContainer
;
import
jadx.dex.nodes.IRegion
;
import
jadx.dex.nodes.InsnNode
;
import
java.util.List
;
public
final
class
SynchronizedRegion
extends
AbstractRegion
{
private
final
RegisterArg
arg
;
private
final
InsnNode
insn
;
private
final
Region
region
;
public
SynchronizedRegion
(
IRegion
parent
,
RegisterArg
arg
)
{
public
SynchronizedRegion
(
IRegion
parent
,
InsnNode
insn
)
{
super
(
parent
);
this
.
arg
=
arg
;
this
.
insn
=
insn
;
this
.
region
=
new
Region
(
this
);
}
public
RegisterArg
getArg
()
{
return
arg
;
public
InsnNode
getInsn
()
{
return
insn
;
}
public
Region
getRegion
()
{
...
...
src/main/java/jadx/dex/visitors/regions/RegionMaker.java
View file @
60615d01
...
...
@@ -9,7 +9,7 @@ import jadx.dex.attributes.LoopAttr;
import
jadx.dex.instructions.IfNode
;
import
jadx.dex.instructions.InsnType
;
import
jadx.dex.instructions.SwitchNode
;
import
jadx.dex.instructions.args.
Register
Arg
;
import
jadx.dex.instructions.args.
Insn
Arg
;
import
jadx.dex.nodes.BlockNode
;
import
jadx.dex.nodes.IRegion
;
import
jadx.dex.nodes.InsnNode
;
...
...
@@ -269,14 +269,13 @@ public class RegionMaker {
private
static
final
Set
<
BlockNode
>
cacheSet
=
new
HashSet
<
BlockNode
>();
private
BlockNode
processMonitorEnter
(
IRegion
curRegion
,
BlockNode
block
,
InsnNode
insn
,
RegionStack
stack
)
{
RegisterArg
arg
=
(
RegisterArg
)
insn
.
getArg
(
0
);
SynchronizedRegion
synchRegion
=
new
SynchronizedRegion
(
curRegion
,
arg
);
SynchronizedRegion
synchRegion
=
new
SynchronizedRegion
(
curRegion
,
insn
);
synchRegion
.
getSubBlocks
().
add
(
block
);
curRegion
.
getSubBlocks
().
add
(
synchRegion
);
Set
<
BlockNode
>
exits
=
new
HashSet
<
BlockNode
>();
cacheSet
.
clear
();
traverseMonitorExits
(
arg
,
block
,
exits
,
cacheSet
);
traverseMonitorExits
(
insn
.
getArg
(
0
)
,
block
,
exits
,
cacheSet
);
block
=
BlockUtils
.
getNextBlock
(
block
);
BlockNode
exit
;
...
...
@@ -298,7 +297,7 @@ public class RegionMaker {
/**
* Traverse from monitor-enter thru successors and collect blocks contains monitor-exit
*/
private
void
traverseMonitorExits
(
Register
Arg
arg
,
BlockNode
block
,
Set
<
BlockNode
>
exits
,
Set
<
BlockNode
>
visited
)
{
private
void
traverseMonitorExits
(
Insn
Arg
arg
,
BlockNode
block
,
Set
<
BlockNode
>
exits
,
Set
<
BlockNode
>
visited
)
{
visited
.
add
(
block
);
for
(
InsnNode
insn
:
block
.
getInstructions
())
{
if
(
insn
.
getType
()
==
InsnType
.
MONITOR_EXIT
...
...
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