[PATCH] D71189: [Parser] Don't crash on MS assembly if target desc/asm parser isn't linked in.

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 9 03:06:53 PST 2019


kadircet added inline comments.


================
Comment at: clang-tools-extra/clangd/unittests/DiagnosticsTests.cpp:1018
 
+
 } // namespace
----------------
nit: empty line


================
Comment at: clang/lib/Parse/ParseStmtAsm.cpp:591
   std::unique_ptr<llvm::MCAsmInfo> MAI(
       TheTarget->createMCAsmInfo(*MRI, TT, MCOptions));
   // Get the instruction descriptor.
----------------
is it ok for MRI to be dereferenced here?


================
Comment at: clang/lib/Parse/ParseStmtAsm.cpp:599
+  if (!MRI || !MAI || !MII | !MOFI || !STI) {
+    Diag(AsmLoc, diag::err_msasm_unable_to_create_target)
+        << "target MC unavailable";
----------------
the original bail out(no target or no tokens) doesn't seem to be emitting diags, are we sure we want to emit diags here? (same for the one below)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71189





More information about the cfe-commits mailing list