diff options
author | Andrew Waterman <andrew@sifive.com> | 2024-03-03 17:39:14 -0800 |
---|---|---|
committer | Andrew Waterman <andrew@sifive.com> | 2024-03-03 18:03:55 -0800 |
commit | 460d3820d0d4e8abbf8613ccf47aaed061665d88 (patch) | |
tree | ae2a0395899fde95b53ba75408b4037b96c6d205 /riscv | |
parent | c820d2b9b485dc0204fc21ec7ea704e8e8c4c4ec (diff) | |
download | spike-460d3820d0d4e8abbf8613ccf47aaed061665d88.zip spike-460d3820d0d4e8abbf8613ccf47aaed061665d88.tar.gz spike-460d3820d0d4e8abbf8613ccf47aaed061665d88.tar.bz2 |
Explicitly capture "this" in lambdas
Suppresses a warning on newer compilers for -std=c++20.
Diffstat (limited to 'riscv')
-rw-r--r-- | riscv/interactive.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/riscv/interactive.cc b/riscv/interactive.cc index d9fb39b..e32c728 100644 --- a/riscv/interactive.cc +++ b/riscv/interactive.cc @@ -413,7 +413,7 @@ void sim_t::interactive_run(const std::string& cmd, const std::vector<std::strin step(1); if (actual_steps < steps) { - next_interactive_action = [=](){ interactive_run(cmd, {std::to_string(steps - actual_steps)}, noisy); }; + next_interactive_action = [=, this](){ interactive_run(cmd, {std::to_string(steps - actual_steps)}, noisy); }; return; } @@ -766,7 +766,7 @@ void sim_t::interactive_until(const std::string& cmd, const std::vector<std::str step(1); } - next_interactive_action = [=](){ interactive_until(cmd, args, noisy); }; + next_interactive_action = [=, this](){ interactive_until(cmd, args, noisy); }; } void sim_t::interactive_dumpmems(const std::string& cmd, const std::vector<std::string>& args) |