[PATCH] D142233: [Clang][OpenMP] Bail out early if `Scope` is nullptr in case of any crash

Alexey Bataev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 20 09:38:00 PST 2023


ABataev added inline comments.


================
Comment at: clang/lib/Sema/SemaOpenMP.cpp:7249
     // checking for any calls inside an Order region
     if (Scope->isOpenMPOrderClauseScope())
       Diag(LParenLoc, diag::err_omp_unexpected_call_to_omp_runtime_api);
----------------
tianshilei1992 wrote:
> ABataev wrote:
> > Maybe better to check it here to avoid too early exit?
> > ```
> > if (Scope && Scope->...)
> > ```
> But does it make sense to continue? I'm not that sure.
Yes, we can get some extra diagnostics, which may be helpful


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D142233



More information about the cfe-commits mailing list