Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
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
6bac5c16
Commit
6bac5c16
authored
Dec 25, 2013
by
Skylot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core: select correct array type element
parent
5cbf71bd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
1 deletion
+44
-1
InsnGen.java
jadx-core/src/main/java/jadx/core/codegen/InsnGen.java
+5
-1
TestTmp2.java
jadx-core/src/test/java/jadx/tests/internal/TestTmp2.java
+39
-0
No files found.
jadx-core/src/main/java/jadx/core/codegen/InsnGen.java
View file @
6bac5c16
...
...
@@ -472,7 +472,11 @@ public class InsnGen {
ArgType
elType
=
insn
.
getElementType
();
if
(!
elType
.
equals
(
insnElementType
)
&&
!
insnArrayType
.
equals
(
ArgType
.
OBJECT
))
{
ErrorsCounter
.
methodError
(
mth
,
"Incorrect type for fill-array insn "
+
InsnUtils
.
formatOffset
(
insn
.
getOffset
()));
"Incorrect type for fill-array insn "
+
InsnUtils
.
formatOffset
(
insn
.
getOffset
())
+
", element type: "
+
elType
+
", insn element type: "
+
insnElementType
);
if
(!
elType
.
isTypeKnown
())
{
elType
=
insnElementType
.
isTypeKnown
()
?
insnElementType
:
elType
.
selectFirst
();
}
}
StringBuilder
str
=
new
StringBuilder
();
Object
data
=
insn
.
getData
();
...
...
jadx-core/src/test/java/jadx/tests/internal/TestTmp2.java
0 → 100644
View file @
6bac5c16
package
jadx
.
tests
.
internal
;
import
jadx.api.InternalJadxTest
;
import
jadx.core.dex.nodes.ClassNode
;
import
org.junit.Test
;
import
static
org
.
hamcrest
.
CoreMatchers
.
containsString
;
import
static
org
.
hamcrest
.
CoreMatchers
.
not
;
import
static
org
.
junit
.
Assert
.
assertThat
;
public
class
TestTmp2
extends
InternalJadxTest
{
public
static
class
TestCls
extends
Exception
{
int
c
;
String
d
;
String
f
;
public
void
testComplexIf
(
String
a
,
int
b
)
{
if
(
d
==
null
||
(
c
==
0
&&
b
!=
-
1
&&
d
.
length
()
==
0
))
{
c
=
a
.
codePointAt
(
c
);
}
else
{
if
(
a
.
hashCode
()
!=
0xCDE
)
{
c
=
f
.
compareTo
(
a
);
}
}
}
}
@Test
public
void
test
()
{
ClassNode
cls
=
getClassNode
(
TestCls
.
class
);
String
code
=
cls
.
getCode
().
toString
();
System
.
out
.
println
(
code
);
assertThat
(
code
,
containsString
(
"return;"
));
assertThat
(
code
,
not
(
containsString
(
"else"
)));
}
}
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