[PATCH] D69146: [install-name-tool] Add first bits for install-name-tool

Alexander Shaposhnikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 18 18:07:40 PST 2019


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


================
Comment at: llvm/tools/llvm-objcopy/CopyConfig.cpp:838
+  Config.InputFilename = Positional[0];
+  Config.OutputFilename = Positional[0];
+
----------------
seiya wrote:
> Missing `InputFormat` and `OutputFormat` initialization?
> 
> ```
>   Config.InputFormat = FileFormat::Unspecified;
>   Config.OutputFormat = FileFormat::Unspecified;
> ```
> 
> It's error-prone so setting it as default member values in `struct CopyConfig` would be better:
> 
> ```
> struct CopyConfig {
>    ...
>    FileFormat InputFormat = FileFormat::Unspecified;
>    FileFormat OutputFormat = FileFormat::Unspecified;
> ```
> 
Hi! no, the root cause was different (the UB was caused by memcpy being called with zero pointer and zero count), but I'll fix this missing initialization as well.
I'm planning to address the issues and recommit my diff today.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D69146





More information about the llvm-commits mailing list