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

Tamir Duberstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 27 19:15:30 PDT 2023


tamird added inline comments.


================
Comment at: llvm/lib/Target/BPF/BPFISelLowering.cpp:872
+  if (HasError) {
+    report_fatal_error("failed to generate BPF instructions, see diagnostics");
+  }
----------------
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).


================
Comment at: llvm/lib/Target/BPF/BPFISelLowering.h:78
 
+  mutable bool HasError = false;
+
----------------
arsenm wrote:
> TargetLowering should not contain state, you don't need this
Did you read the description?


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