lcompilers / lpython

Python compiler
https://lpython.org/
Other
1.37k stars 156 forks source link

Fix logical comparsion for string #2699

Closed hankluo6 closed 1 month ago

hankluo6 commented 1 month ago

Fixes #2615

The problem is that _lpython_str_compare_eq requires pointer to pointer to char as parameters. However, the previous implementation passed a null pointer, leading to a segmentation fault.

kmr-srbh commented 1 month ago

Thanks for this @hankluo6! The PR looks good! :+1:

hankluo6 commented 1 month ago

Thank you @anutosh491! I raised an issue #2708 for this.

anutosh491 commented 1 month ago

Could you maybe add a TODO here saying that we can add the C backend once the above issue you raised has been fixed ? https://github.com/lcompilers/lpython/blob/fbbdbdd83e866a4ebbb7a5541bd7989be60c5fe1/integration_tests/CMakeLists.txt#L768-L769

I guess that would be sufficient enough to merge this !