summaryrefslogtreecommitdiff
path: root/cli/runtime-source.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-03-21 13:19:18 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-03-21 13:19:18 +0200
commit6520b63cb25580420e477cba2c776b2639cbf21b (patch)
treeb166ff171780389a0f079ae587dd8cc75fb0d68e /cli/runtime-source.cxx
parent1dea398d6f864c99b9e1c34e4a718239cfd3d8ac (diff)
Guarantee validity of values returned by scanner for two arguments
Diffstat (limited to 'cli/runtime-source.cxx')
-rw-r--r--cli/runtime-source.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/cli/runtime-source.cxx b/cli/runtime-source.cxx
index 49c1bf2..e3be19e 100644
--- a/cli/runtime-source.cxx
+++ b/cli/runtime-source.cxx
@@ -356,9 +356,9 @@ generate_runtime_source (context& ctx, bool complete)
<< "return base::next ();"
<< "else"
<< "{"
- << "hold_.swap (args_.front ());"
+ << "hold_[i_ == 0 ? ++i_ : --i_].swap (args_.front ());"
<< "args_.pop_front ();"
- << "return hold_.c_str ();"
+ << "return hold_[i_].c_str ();"
<< "}"
<< "}"
@@ -530,7 +530,7 @@ generate_runtime_source (context& ctx, bool complete)
<< "{"
<< "using namespace std;"
<< endl
- << "string o (s.next ());"
+ << "const char* o (s.next ());"
<< endl
<< "if (s.more ())"
<< "{"