facebookarchive / BOLT

Binary Optimization and Layout Tool - A linux command-line utility used for optimizing performance of binaries
2.51k stars 177 forks source link

A Problem about IsSimple be used in disassemble #303

Open CcWeapon opened 1 year ago

CcWeapon commented 1 year ago

According to the definition of IsSimple, the function whose IsSimple is false is still disassembled in relocation mode.

  /// False if the function is too complex to reconstruct its control
  /// flow graph.
  /// In relocation mode we still disassemble and re-assemble such functions.
  bool IsSimple{true};

But as I read the code and tried it out, if a method is set to IsSimple=false in discoverFileObjects(), the method will be considered disassemble. The following code snippet ends at BinaryFunction::disassemable().

  if (!IsSimple) {
    clearList(Instructions);
    return false;
  }

Is this a bug, or am I misunderstood?

@maksfb