[llvm] [RISCV][Disassemble] Ensure the comment stream of the disassembler is set. (PR #125962)

Francesco Petrogalli via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 6 08:59:03 PST 2025


================
@@ -131,6 +131,11 @@ class MCDisassembler {
   ///                   MCDisassembler::SoftFail if the instruction was
   ///                                            disassemblable but invalid,
   ///                   MCDisassembler::Fail if the instruction was invalid.
+  ///
+  /// Note: to avoid potential issues caused by the field
----------------
fpetrogalli wrote:

One of our internal builds (sanitizers) fails if we do not set the CommentStream for the target:

```
<...>/llvm-project/llvm/lib/MC/MCDisassembler/MCDisassembler.cpp:33:55: runtime error: reference binding to null pointer of type 'raw_ostream'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior <...>/llvm-project/llvm/lib/MC/MCDisassembler/MCDisassembler.cpp:33:55 
```

Maybe I can just remove the comment?

https://github.com/llvm/llvm-project/pull/125962


More information about the llvm-commits mailing list