[PATCH] D83491: [flang] Fix a crash when creating generics from a copy

Pete Steinfeld via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 9 14:47:10 PDT 2020


PeteSteinfeld marked an inline comment as done.
PeteSteinfeld added inline comments.


================
Comment at: flang/lib/Semantics/symbol.cpp:211
+    }
+  }
 }
----------------
tskeith wrote:
> I think that `specificProcs_` and `bindingNames_` are supposed to be parallel vectors; at least that is the assumption in `CheckHelper::CheckGeneric`. So this should be written as a single loop that pushes onto the two lists at the same time. As it's written it looks like the two loops might push different numbers of elements on the two lists.
> 
> One thing that suggests that the above assumption is wrong is the existence of this constructor: `GenericDetails(const SymbolVector &specificProcs);`. But I'm not sure it is ever used, so it would be good if you can delete it as part of this change.
After doing some testing, I believe that you're correct that they're supposed to be parallel vectors.  I'll put some calls to `CHECK()` into `CopyFrom()` to verify that their sizes match and copy them as pairs.

You're also correct that the constructor `GenericDetails(const SymbolVector &specificProcs)` is not used.  I'll delete it.

Thanks for the guidance!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D83491





More information about the llvm-commits mailing list