Hello Daniel. I just finished implementing the function calls. I am developing m...

nikolaos Panagopoulos Answered 4 answers
Question by nikolaos Panagopoulos 2 years ago

Question

Hello Daniel. I just finished implementing the function calls. I am developing my own version now with improvements and memory managment. in the codegen_generate_exp_node_for_arithmetic , the node->exp.right is NULL. and I get a seg fault, before the one in the video. I traced it with gdb. what could be responsible?
https://github.com/nikolaospanagopoulos/panagoCompiler
here is a link to my code, but you dont need to see it. just tell me if you can , what could be responsible.

thank you, you are amazing

Answers

Answered by Daniel McCarthy

Instructor

Hello Nikolaos,
Im very happy that you have been making your own adjustments to the project to further your learning, shows a great interest in the subject. Regarding the problem I have no idea you will need to compare your changes with mine to see what mistake was made. Take a look at the commits on each lecture, I have ensured a commit for each coding lecture to assist students with debugging. Compare your code with the working repository and you will find your problem. GDB is also a great took to help identify issues as you've seen already by tracing what the actual problem is. Now you can use GDB to find the root cause which will solve your problem. Its only possible for me to tell what your mistake was if I was to debug your whole project and due to the demand for this course it is difficult when it comes to analyzing students code as I have many thousands of students.

If you have issues with the debugging please let me know and I can advise further. Additionally I need to note that sometimes even I can make mistakes and these get corrected in future videos so if you believe this to be a mistake on my own part please take a look at the final commit in the repository to see if it works as expected.

Follow-up by nikolaos Panagopoulos

Question author

thank you Daniel!! I wish the best! looking forward to new courses!

Answered by Daniel McCarthy

Instructor

Your more than welcome, keep a look out on the newsletters for new releases take care and reach out if you have problems

Follow-up by nikolaos Panagopoulos

Question author

I managed to solve it ! thank you very much Daniel!