[PATCH] D87406: [DebugInfo] Fixing CodeView assert related to lowerBound field of DISubrange.

Reid "Away June-Sep" Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 10 09:19:46 PDT 2020


rnk added inline comments.


================
Comment at: llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp:1588-1589
+
     int64_t Count = -1;
     if (auto *CI = Subrange->getCount().dyn_cast<ConstantInt*>())
       Count = CI->getSExtValue();
----------------
I think we should handle the presence of anything we don't understand (non-zero lower bound, stride, and upper bound) as a VLA. As in, translate it to an array count of -1. That's how we can eliminate the assertion. If the user tries to emit codeview when compiling fortran with these types of arrays, they would probably prefer to have an array bound of zero in their debug info than for the compiler to crash.

I should've provided that guidance during the original review when this code landed. The author was trying to be cautious.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D87406



More information about the llvm-commits mailing list