[PATCH] D156497: [BPF] report fatal error rather than miscompile

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 2 16:55:03 PDT 2023


arsenm added inline comments.


================
Comment at: llvm/lib/Target/BPF/BPFISelLowering.cpp:872
+  if (HasError) {
+    report_fatal_error("failed to generate BPF instructions, see diagnostics");
+  }
----------------
tamird wrote:
> arsenm wrote:
> > Just let the proper context error happen, this is just worse
> Please read the description. The problem is that without fataling, the embedder can use the miscompiled code (and we saw this because our diagnostic handler did not treat error as fatal).
Then your compiler driver / embedder / whatever is broken and needs to check the context. TargetLowering must not be stateful and you should not emit a fatal error here


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D156497



More information about the llvm-commits mailing list