mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-01 22:02:45 +01: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:
@@ -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