skylot/jadx · error · JadxRuntimeException

Unexpected InsnArg types: {} and {}

Error message

Unexpected InsnArg types: {} and {}

What it means

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.

Source

Thrown at jadx-core/src/main/java/jadx/core/dex/visitors/blocks/BlockProcessor.java:279

		}
		return false;
	}

	private static boolean sameArgs(@Nullable InsnArg arg, @Nullable InsnArg otherArg) {
		if (arg == otherArg) {
			return true;
		}
		if (arg == null || otherArg == null) {
			return false;
		}
		if (arg.getClass().equals(otherArg.getClass())) {
			if (arg.isRegister()) {
				return ((RegisterArg) arg).getRegNum() == ((RegisterArg) otherArg).getRegNum();
			}
			if (arg.isLiteral()) {
				return ((LiteralArg) arg).getLiteral() == ((LiteralArg) otherArg).getLiteral();
			}
			throw new JadxRuntimeException("Unexpected InsnArg types: " + arg + " and " + otherArg);
		}
		return false;
	}

	private static InsnNode getInsnsFromEnd(BlockNode block, int number) {
		List<InsnNode> instructions = block.getInstructions();
		int insnCount = instructions.size();
		if (insnCount <= number) {
			return null;
		}
		return instructions.get(insnCount - number - 1);
	}

	private static void computeDominators(MethodNode mth) {
		clearBlocksState(mth);
		DominatorTree.compute(mth);
		markLoops(mth);
	}

View on GitHub (pinned to e738a26571)

Solutions

  1. Update jadx — if this is a known internal issue it will be fixed in a patch release
  2. Report as a jadx issue with the full stack trace — this is an internal contract violation
  3. This is not fixable from user input; it requires a jadx code fix
Defensive patterns

Strategy: try-catch

Try / catch

try {
    jadxDecompiler.load();
    jadxDecompiler.save();
} catch (JadxRuntimeException e) {
    if (e.getMessage().contains("Unexpected InsnArg types")) {
        LOG.error("Internal jadx bug: unhandled InsnArg subclass. Report to jadx project.", e);
        // This is a development bug, not fixable from input
    } else {
        throw e;
    }
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of skylot/jadx@e738a26571 (2026-08-14). Data as JSON: /api/errors/36c11c5ad177a00a. Report an issue: GitHub.