mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-16 21:58:11 +00:00
Fix infinite recursion in PrintList. (#642)
Also make `Stack`'s single-argument constructor explicit, which would have helped catch this at compile time.
This commit is contained in:
1 parent
6fa42a7f3c
commit
69b4b0086f
2 files changed
+2
-2
No files matched your search
@@ -102,7 +102,7 @@ void Action::Print(std::ostream& out) {
|
||||
|
||||
void Action::PrintList(Stack<Action*> ls, std::ostream& out) {
|
||||
if (!ls.IsEmpty()) {
|
||||
PrintList(ls.Pop(), out);
|
||||
ls.Pop()->Print(out);
|
||||
if (!ls.IsEmpty()) {
|
||||
out << " :: ";
|
||||
PrintList(ls, out);
|
||||
|
||||
Reference in new issue
Block a user