Example #1
0
  public DecompilerIfBlock(
      Block block,
      Decompiler decompiler,
      List<DecompilerBlock> thenBranch,
      List<DecompilerBlock> elseBranch,
      PrintStream infoStream) {
    super(block, decompiler);
    this.thenBranch = thenBranch;
    this.elseBranch = elseBranch;
    this.infoStream = infoStream;
    this.head = new DecompilerBasicBlock(block, decompiler, decompiler.getSchedule());

    if (!(thenBranch.isEmpty() == false
            && head.getBlock().getSuccessors().contains(thenBranch.get(0).getBlock())
        || (elseBranch.isEmpty() == false
            && head.getBlock().getSuccessors().contains(elseBranch.get(0).getBlock())))) {
      // first block of then / else MUST be a successor of the head!
      throw new AssertionError(decompiler.contexInformation);
    }
  }