ayzhao added inline comments.

================
Comment at: clang/lib/Serialization/ASTReaderStmt.cpp:2179
+  for (unsigned I = 0; I < E->NumExprs; I++)
+    E->getTrailingObjects<Expr *>()[I] = Record.readSubExpr();
+}
----------------
ilya-biryukov wrote:
> FYI: I think this is where the crash comes from.
> We should allocate the trailing objects first.
> E.g. see how `PragmaCommentDecl::CreateDeserialized` does this.
This sounds like it could be the solution - thanks for looking at it!

Currently, I'm working on the refactor that shafik@ suggested, which was to 
inherit from `InitListExpr`. Hopefully, that refactor will fix this issue as 
`InitListExpr` stores it's subexpressions in a class member instead of using 
`llvm::TrailingObjects`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D129531

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to