[PATCH] D131632: [clang] Enable output of SARIF diagnostics

Christopher Di Bella via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 25 11:46:51 PDT 2022


cjdb added inline comments.


================
Comment at: clang/lib/Frontend/SARIFDiagnostic.cpp:191
+#ifdef _WIN32
+      TmpFilename = (*File)->getName();
+      llvm::sys::fs::make_absolute(TmpFilename);
----------------
denik wrote:
> cjdb wrote:
> > aaron.ballman wrote:
> > > Note: this is not a particularly small string when it requires 4k by default.
> > There's a bug either here or in the function's interface: the function returns a `StringRef` to a stack object. Do we really need ownership here?
> > Note: this is not a particularly small string when it requires 4k by default.
> 
> This still has to be addressed.
> There's a bug either here or in the function's interface: the function returns a StringRef to a stack object. Do we really need ownership here?

Disregard, I misread `TmpFilename` as `Filename` and thought we were returning a dangling reference. That isn't the case, so there is no bug.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D131632



More information about the cfe-commits mailing list