mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-26 03:15:19 +00:00
[lldb/Utility] Fix unspecified behavior.
Order of evaluation of the operands of any C++ operator [...] is unspecified. This patch fixes the issue in Stream::Indent by calling the function consecutively. On my Windows setup, TestSettings.py fails because the function prints the value first, followed by the indentation. Expected result: MY_FILE=this is a file name with spaces.txt Actual result: MY_FILE =this is a file name with spaces.txt
This commit is contained in:
parent
2c0edbf19c
commit
35a0614535
@ -127,8 +127,9 @@ size_t Stream::PrintfVarArg(const char *format, va_list args) {
|
||||
size_t Stream::EOL() { return PutChar('\n'); }
|
||||
|
||||
size_t Stream::Indent(llvm::StringRef str) {
|
||||
std::string indentation(m_indent_level, ' ');
|
||||
return PutCString(indentation) + PutCString(str);
|
||||
const size_t ind_length = PutCString(std::string(m_indent_level, ' '));
|
||||
const size_t str_length = PutCString(str);
|
||||
return ind_length + str_length;
|
||||
}
|
||||
|
||||
// Stream a character "ch" out to this stream.
|
||||
|
Loading…
x
Reference in New Issue
Block a user