{"record":{"id":"b96ecbb7b28170c2","repo":"skylot/jadx","slug":"no-immediate-dominator-for-block","errorCode":null,"errorMessage":"No immediate dominator for block: {}","messagePattern":"No immediate dominator for block: (.+?)","errorType":"exception","errorClass":"JadxRuntimeException","httpStatus":null,"severity":"error","filePath":"jadx-core/src/main/java/jadx/core/dex/visitors/blocks/DominatorTree.java","lineNumber":61,"sourceCode":"\t\tdoms[0] = sorted.get(0);\n\t\tboolean changed = true;\n\t\twhile (changed) {\n\t\t\tchanged = false;\n\t\t\tfor (int blockId = 1; blockId < blocksCount; blockId++) {\n\t\t\t\tBlockNode b = sorted.get(blockId);\n\t\t\t\tList<BlockNode> preds = predFunc.apply(b);\n\t\t\t\tint pickedPred = -1;\n\t\t\t\tBlockNode newIDom = null;\n\t\t\t\tfor (BlockNode pred : preds) {\n\t\t\t\t\tint id = pred.getId();\n\t\t\t\t\tif (doms[id] != null) {\n\t\t\t\t\t\tnewIDom = pred;\n\t\t\t\t\t\tpickedPred = id;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (newIDom == null) {\n\t\t\t\t\tthrow new JadxRuntimeException(\"No immediate dominator for block: \" + b);\n\t\t\t\t}\n\t\t\t\tfor (BlockNode predBlock : preds) {\n\t\t\t\t\tint predId = predBlock.getId();\n\t\t\t\t\tif (predId == pickedPred) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif (doms[predId] != null) {\n\t\t\t\t\t\tnewIDom = intersect(sorted, doms, predBlock, newIDom);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (doms[blockId] != newIDom) {\n\t\t\t\t\tdoms[blockId] = newIDom;\n\t\t\t\t\tchanged = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn doms;\n\t}","sourceCodeStart":43,"sourceCodeEnd":79,"githubUrl":"https://github.com/skylot/jadx/blob/e738a26571d02919f01df40de93bc9a44dee4e18/jadx-core/src/main/java/jadx/core/dex/visitors/blocks/DominatorTree.java#L43-L79","documentation":"Thrown during dominator tree construction using the Cooper-Harvey-Kennedy algorithm. For each non-entry block, the algorithm looks for at least one predecessor with an already-computed dominator. If no predecessor has one, the block has no starting point for dominator intersection and the algorithm cannot proceed.","triggerScenarios":"For a non-entry block, all predecessors have null dominator entries (doms[id] == null for every pred). This violates the algorithm's assumption that blocks are processed in reverse-postorder with at least one already-dominated predecessor.","commonSituations":"Blocks in the sorted list whose predecessors all appear later (ordering violation); disconnected CFG components where a block's predecessors are in a different SCC; bugs in the DFS-based block sorting that produce incorrect reverse-postorder.","solutions":["Update jadx — dominator construction is periodically hardened","Report the APK as a jadx issue — include the block structure from the stack trace","This is an internal algorithmic issue, not fixable from user input","Try decompiling specific classes to avoid the problematic method"],"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(\"No immediate dominator\")) {\n        LOG.warn(\"Dominator computation ordering issue, skipping problematic method\");\n        for (ClassNode cls : jadxDecompiler.getClasses()) {\n            try {\n                jadxDecompiler.decompileClass(cls);\n            } catch (JadxRuntimeException ex) {\n                LOG.warn(\"Skipped: {}\", cls.getFullName());\n            }\n        }\n    } else {\n        throw e;\n    }\n}","preventionTips":["Keep jadx updated — dominator construction is periodically hardened","Report the APK as a jadx issue — this is an internal algorithmic issue","Decompile specific classes to avoid the problematic method","This error is not fixable from user input"],"tags":["dominator-tree","control-flow","algorithm","decompiler"],"backgroundTag":null,"analyzedSha":"e738a26571d02919f01df40de93bc9a44dee4e18","analyzedAt":"2026-08-14T00:10:24.238Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}