cool-compiler icon indicating copy to clipboard operation
cool-compiler copied to clipboard

Cycle checking issue in check_inheritance function in PA4

Open Oxer11 opened this issue 4 years ago • 1 comments

您好,感谢您的代码分享!在check_inheritance函数中似乎有一个问题,判断是否成环不能仅判断一个节点是否最终会返回到自己。比如,D : A, A : B, B : C, C : A的情况,如果从D开始判断的话会死循环。

https://github.com/afterthat97/cool-compiler/blob/d83175f723d3469527b2c63d20ebe9f12c653b46/assignments/PA4/semant.cc#L315-L337

Oxer11 avatar Dec 22 '20 10:12 Oxer11

你说的好像很有道理。。要不你提一个Pull Request吧,谢谢啦

afterthat97 avatar Dec 29 '21 10:12 afterthat97