[flang-commits] [flang] 1a3ac58 - [flang][runtime] Fix handling of output FORMAT('x' 'y')
Peter Klausler via flang-commits
flang-commits at lists.llvm.org
Wed Jun 15 14:28:04 PDT 2022
Author: Peter Klausler
Date: 2022-06-15T14:23:02-07:00
New Revision: 1a3ac586670df10a48b1adece9624589788cb21b
URL: https://github.com/llvm/llvm-project/commit/1a3ac586670df10a48b1adece9624589788cb21b
DIFF: https://github.com/llvm/llvm-project/commit/1a3ac586670df10a48b1adece9624589788cb21b.diff
LOG: [flang][runtime] Fix handling of output FORMAT('x' 'y')
I'm emitting "x'y" because the space-separated apostrophes are
misinterpreted as being adjacent repeated quotation marks.
Fix to ensure no space skipping is applied when checking for
repeated quotation marks.
Differential Revision: https://reviews.llvm.org/D127792
Added:
Modified:
flang/runtime/format-implementation.h
Removed:
################################################################################
diff --git a/flang/runtime/format-implementation.h b/flang/runtime/format-implementation.h
index cec51d8d957e..4ebd84aacb15 100644
--- a/flang/runtime/format-implementation.h
+++ b/flang/runtime/format-implementation.h
@@ -293,7 +293,7 @@ int FormatControl<CONTEXT>::CueUpNextDataEdit(Context &context, bool stop) {
++offset_;
std::size_t chars{
static_cast<std::size_t>(&format_[offset_] - &format_[start])};
- if (PeekNext() == quote) {
+ if (offset_ < formatLength_ && format_[offset_] == quote) {
// subtle: handle doubled quote character in a literal by including
// the first in the output, then treating the second as the start
// of another character literal.
More information about the flang-commits
mailing list