Skip to content

Commit

Permalink
fix: string signature in SignatureResolver
Browse files Browse the repository at this point in the history
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
  • Loading branch information
oSumAtrIX committed Jun 5, 2022
1 parent 612515a commit e5ae970
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,18 @@ internal class SignatureResolver(
}
}

method.implementation?.instructions?.let { instructions ->
signature.strings?.let {
val stringsList = it as MutableSet
signature.strings?.let { strings ->
method.implementation ?: return null

method.implementation!!.instructions.let { instructions ->
val stringsList = strings.toMutableList()

for (instruction in instructions) {
if (instruction.opcode != Opcode.CONST_STRING) continue

val string = ((instruction as Instruction21c).reference as StringReference).string
if (stringsList.contains(string)) {
stringsList.remove(string)
}
val i = stringsList.indexOfFirst { it == string }
if (i != -1) stringsList.removeAt(i)
}

if (stringsList.isNotEmpty()) return null
Expand Down

0 comments on commit e5ae970

Please sign in to comment.