[PATCH] D106417: [llvm-mc-assemble-fuzzer] Initialize MCTargetOptions.
Hsiangkai Wang via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 20 19:40:56 PDT 2021
HsiangKai created this revision.
HsiangKai added a reviewer: bcain.
Herald added a subscriber: kristof.beyls.
HsiangKai requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
When run the command in the llvm-mc-assemble-fuzzer document,
llvm-mc-fuzzer --triple=aarch64-linux-gnu --fuzzer-args -max_len=4
it triggers the following assertion:
llvm-mc-assemble-fuzzer:
llvm-project/llvm/lib/MC/MCTargetOptionsCommandFlags.cpp:38:
bool llvm::mc::getRelaxAll(): Assertion `RelaxAllView &&
"RegisterMCTargetOptionsFlags not created."' failed.
It is caused by no global RegisterMCTargetOptionsFlags object to initialize
the MC target options.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D106417
Files:
llvm/tools/llvm-mc-assemble-fuzzer/llvm-mc-assemble-fuzzer.cpp
Index: llvm/tools/llvm-mc-assemble-fuzzer/llvm-mc-assemble-fuzzer.cpp
===================================================================
--- llvm/tools/llvm-mc-assemble-fuzzer/llvm-mc-assemble-fuzzer.cpp
+++ llvm/tools/llvm-mc-assemble-fuzzer/llvm-mc-assemble-fuzzer.cpp
@@ -37,6 +37,8 @@
using namespace llvm;
+static mc::RegisterMCTargetOptionsFlags MCTargetOptionsFlags;
+
static cl::opt<std::string>
TripleName("triple", cl::desc("Target triple to assemble for, "
"see -version for available targets"));
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106417.360346.patch
Type: text/x-patch
Size: 555 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210721/b8ac392f/attachment.bin>
More information about the llvm-commits
mailing list