Skip to content

Commit

Permalink
add log error
Browse files Browse the repository at this point in the history
  • Loading branch information
firmianay committed Nov 15, 2023
1 parent a341df3 commit 187a68b
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions src/main/kotlin/net/bytedance/security/app/util/helper.kt
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ fun newFunctionSignature(methodSig: String): FunctionSignature {
for (i in 1 until methodSig.length - 1) {
when (val c = methodSig[i]) {
':' -> if (state != MethodSignatureParseState.Class) {
logErr("Format Error $methodSig")
exitProcess(-2)
} else {
// state = ParseState.Space
Expand All @@ -80,7 +81,10 @@ fun newFunctionSignature(methodSig: String): FunctionSignature {
state = MethodSignatureParseState.FunctionName
}

else -> exitProcess(-7)
else -> {
logErr("Format Error $methodSig")
exitProcess(-7)
}
}
}

Expand All @@ -91,9 +95,10 @@ fun newFunctionSignature(methodSig: String): FunctionSignature {
s = ""
}

MethodSignatureParseState.ReturnType -> {}

else -> exitProcess(-8)
else -> {
logErr("Format Error $methodSig")
exitProcess(-8)
}
}
}

Expand All @@ -105,7 +110,10 @@ fun newFunctionSignature(methodSig: String): FunctionSignature {
state = MethodSignatureParseState.Argument
}

else -> exitProcess(-9)
else -> {
logErr("Format Error $methodSig")
exitProcess(-9)
}
}
}

Expand All @@ -116,7 +124,10 @@ fun newFunctionSignature(methodSig: String): FunctionSignature {
s = ""
}

else -> exitProcess(-10)
else -> {
logErr("Format Error $methodSig")
exitProcess(-10)
}
}
}

Expand Down

0 comments on commit 187a68b

Please sign in to comment.