{"record":{"id":"36c11c5ad177a00a","repo":"skylot/jadx","slug":"unexpected-insnarg-types-and","errorCode":null,"errorMessage":"Unexpected InsnArg types: {} and {}","messagePattern":"Unexpected InsnArg types: (.+?) and (.+?)","errorType":"exception","errorClass":"JadxRuntimeException","httpStatus":null,"severity":"error","filePath":"jadx-core/src/main/java/jadx/core/dex/visitors/blocks/BlockProcessor.java","lineNumber":279,"sourceCode":"\t\t}\n\t\treturn false;\n\t}\n\n\tprivate static boolean sameArgs(@Nullable InsnArg arg, @Nullable InsnArg otherArg) {\n\t\tif (arg == otherArg) {\n\t\t\treturn true;\n\t\t}\n\t\tif (arg == null || otherArg == null) {\n\t\t\treturn false;\n\t\t}\n\t\tif (arg.getClass().equals(otherArg.getClass())) {\n\t\t\tif (arg.isRegister()) {\n\t\t\t\treturn ((RegisterArg) arg).getRegNum() == ((RegisterArg) otherArg).getRegNum();\n\t\t\t}\n\t\t\tif (arg.isLiteral()) {\n\t\t\t\treturn ((LiteralArg) arg).getLiteral() == ((LiteralArg) otherArg).getLiteral();\n\t\t\t}\n\t\t\tthrow new JadxRuntimeException(\"Unexpected InsnArg types: \" + arg + \" and \" + otherArg);\n\t\t}\n\t\treturn false;\n\t}\n\n\tprivate static InsnNode getInsnsFromEnd(BlockNode block, int number) {\n\t\tList<InsnNode> instructions = block.getInstructions();\n\t\tint insnCount = instructions.size();\n\t\tif (insnCount <= number) {\n\t\t\treturn null;\n\t\t}\n\t\treturn instructions.get(insnCount - number - 1);\n\t}\n\n\tprivate static void computeDominators(MethodNode mth) {\n\t\tclearBlocksState(mth);\n\t\tDominatorTree.compute(mth);\n\t\tmarkLoops(mth);\n\t}","sourceCodeStart":261,"sourceCodeEnd":297,"githubUrl":"https://github.com/skylot/jadx/blob/e738a26571d02919f01df40de93bc9a44dee4e18/jadx-core/src/main/java/jadx/core/dex/visitors/blocks/BlockProcessor.java#L261-L297","documentation":"Thrown when comparing two InsnArg objects of the same Java class. The comparison logic only knows how to compare RegisterArg (by register number) and LiteralArg (by literal value). If two args share a class that is neither of these, the comparison is undefined and the code asserts — indicating an unhandled InsnArg subclass was introduced.","triggerScenarios":"Two InsnArg instances pass the arg.getClass().equals(otherArg.getClass()) check but fail both isRegister() and isLiteral() checks. This means a non-Register, non-Literal InsnArg subclass exists and was compared.","commonSituations":"This is almost always a jadx internal development issue, not an input-driven error. A new InsnArg subclass was added without updating this comparison method. Extremely rare in practice as the InsnArg hierarchy is stable.","solutions":["Update jadx — if this is a known internal issue it will be fixed in a patch release","Report as a jadx issue with the full stack trace — this is an internal contract violation","This is not fixable from user input; it requires a jadx code fix"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    jadxDecompiler.load();\n    jadxDecompiler.save();\n} catch (JadxRuntimeException e) {\n    if (e.getMessage().contains(\"Unexpected InsnArg types\")) {\n        LOG.error(\"Internal jadx bug: unhandled InsnArg subclass. Report to jadx project.\", e);\n        // This is a development bug, not fixable from input\n    } else {\n        throw e;\n    }\n}","preventionTips":["Update jadx to the latest version — this is an internal contract violation","Report immediately as a jadx issue with the full stack trace","This error cannot be prevented by user input configuration"],"tags":["instruction-args","internal-bug","comparison","decompiler"],"backgroundTag":null,"analyzedSha":"e738a26571d02919f01df40de93bc9a44dee4e18","analyzedAt":"2026-08-14T00:10:24.238Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}