================
@@ -1446,6 +1446,33 @@ bool
DisassemblerLLVMC::MCDisasmInstance::IsAuthenticated(
return InstrDesc.isAuthenticated() || IsBrkC47x;
}
+void DisassemblerLLVMC::UpdateFeatureString(llvm::StringRef
additional_features,
+ std::string &features) {
+ // Allow users to override default additional features.
+ for (llvm::StringRef flag : llvm::split(additional_features, ",")) {
+ flag = flag.trim();
+ if (flag.empty())
+ continue;
+ // By default, if both +flag and -flag are present in the feature string,
+ // disassembler keeps the feature enabled (+flag).
+ // To respect user intent, we make -flag(user) take priority over the
+ // default +flag coming from ELF.
+ bool add_flag = true;
+ if (flag.starts_with('+')) {
+ std::string disable_flag = "-" + flag.substr(1).str();
----------------
DavidSpickett wrote:
If my feature string is `+,....` (just a plus, no feature name) then this goes
out of bounds.
https://github.com/llvm/llvm-project/pull/147990
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits