{"record":{"id":"6832d3737c0d8309","repo":"skylot/jadx","slug":"unknown-instruction","errorCode":null,"errorMessage":"Unknown instruction: ","messagePattern":"Unknown instruction: ","errorType":"exception","errorClass":"CodegenException","httpStatus":null,"severity":"error","filePath":"jadx-core/src/main/java/jadx/core/codegen/InsnGen.java","lineNumber":649,"sourceCode":"\t\t\t\t\tcode.add(\" = \");\n\t\t\t\t\taddArg(code, insn.getArg(i + 1));\n\t\t\t\t\tcode.add(\"; \");\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase JAVA_JSR:\n\t\t\t\tfallbackOnlyInsn(insn);\n\t\t\t\tcode.add(\"jsr -> \").add(MethodGen.getLabelName(((JsrNode) insn).getTarget()));\n\t\t\t\tbreak;\n\n\t\t\tcase JAVA_RET:\n\t\t\t\tfallbackOnlyInsn(insn);\n\t\t\t\tcode.add(\"ret \");\n\t\t\t\taddArg(code, insn.getArg(0));\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tthrow new CodegenException(mth, \"Unknown instruction: \" + insn.getType());\n\t\t}\n\t}\n\n\t/**\n\t * In most cases must be combined with new array instructions.\n\t * Use one by one array fill (can be replaced with System.arrayCopy)\n\t */\n\tprivate void fillArray(ICodeWriter code, FillArrayInsn arrayNode) throws CodegenException {\n\t\tif (mth.checkCommentsLevel(CommentsLevel.INFO)) {\n\t\t\tcode.add(\"// fill-array-data instruction\");\n\t\t}\n\t\tcode.startLine();\n\t\tInsnArg arrArg = arrayNode.getArg(0);\n\t\tArgType arrayType = arrArg.getType();\n\t\tArgType elemType;\n\t\tif (arrayType.isTypeKnown() && arrayType.isArray()) {\n\t\t\telemType = arrayType.getArrayElement();\n\t\t} else {","sourceCodeStart":631,"sourceCodeEnd":667,"githubUrl":"https://github.com/skylot/jadx/blob/e738a26571d02919f01df40de93bc9a44dee4e18/jadx-core/src/main/java/jadx/core/codegen/InsnGen.java#L631-L667","documentation":"Thrown by InsnGen.makeInsnBody() as the default branch of the large switch on insn.getType(). The switch covers dozens of InsnType values (CONST_STR, INVOKE, MOVE, etc.) plus the legacy JAVA_JSR and JAVA_RET fallback cases. Reaching the default means an instruction type is not handled — either a new InsnType was added without a case, or internal state produced an unexpected type.","triggerScenarios":"An InsnNode with an InsnType value not covered by the switch. Adding a new instruction type to InsnType without adding a case in makeInsnBody(). Corrupted instruction nodes with wrong type tags.","commonSituations":"Contributing new instruction support to jadx without updating makeInsnBody(). Rare in normal use — typically a development-time guard. Some uncommon bytecode patterns may produce instructions that reach this point in older jadx versions.","solutions":["If you added a new InsnType, add a matching case in makeInsnBody().","Update jadx to the latest version where more instruction types may be handled.","Report the class and instruction type to the jadx issue tracker."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    insnGen.makeInsn(insn, code);\n} catch (CodegenException e) {\n    if (e.getMessage().startsWith(\"Unknown instruction\")) {\n        code.startLine(\"// jadx: unknown instruction type: \" + insn.getType());\n        logger.warn(\"Unknown instruction type in codegen\", e);\n        // Continue with next instruction\n    } else {\n        throw e;\n    }\n}","preventionTips":["If you add a new InsnType, update InsnGen.makeInsnBody() with a case.","Update jadx to the latest version where more instruction types are supported.","Report unhandled instruction types to the jadx issue tracker."],"tags":["codegen","instruction","exhaustive-switch","internal-bug"],"backgroundTag":null,"analyzedSha":"e738a26571d02919f01df40de93bc9a44dee4e18","analyzedAt":"2026-08-14T00:10:24.238Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}