[PATCH] D138176: [dsymutil] Fix assertion: (Ref > InputDIE.getOffset()), function cloneDieReferenceAttribute

Alexey Lapshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 16 11:15:50 PST 2022


avl added a comment.

Since this patch extends number of cases when uncloned dies are created, it is worth to add following check:

  void CompileUnit::fixupForwardReferences() {
    for (const auto &Ref : ForwardDIEReferences) {
      DIE *RefDie;
      const CompileUnit *RefUnit;
      PatchLocation Attr;
      DeclContext *Ctxt;
      std::tie(RefDie, RefUnit, Ctxt, Attr) = Ref;
      if (Ctxt && Ctxt->hasCanonicalDIE()) {
        assert(Ctxt->getCanonicalDIEOffset() &&
               "Canonical die offset is not set");
        Attr.set(Ctxt->getCanonicalDIEOffset());
      } else {
        assert(RefDie->getOffset() && "Referenced die offset is not set");    <<<<<<<<<<<<<<<<<<<<
        Attr.set(RefDie->getOffset() + RefUnit->getStartOffset());
      }
    }
  }


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138176/new/

https://reviews.llvm.org/D138176



More information about the llvm-commits mailing list