Skip to content

_lpython_bit_length1 fails using conda-forge lpython #1825

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Tracked by #1600
certik opened this issue May 17, 2023 · 0 comments · Fixed by #1835
Closed
Tracked by #1600

_lpython_bit_length1 fails using conda-forge lpython #1825

certik opened this issue May 17, 2023 · 0 comments · Fixed by #1835
Labels
bug Something isn't working

Comments

@certik
Copy link
Contributor

certik commented May 17, 2023

This function seems to inter infinite loop:

LFORTRAN_API int32_t _lpython_bit_length1(int8_t num)
{
    int32_t res = 0;
    num = abs(num);
    for(; num; num >>= 1, res++);
    return res;
}

On Apple M1, using conda-forge. Steps to reproduce (with #1824):

mamba create -n t1 lpython python numpy
conda activate t1
cd integration_tests
./run_tests.py

It will hang in test_bit_length. This patch makes it pass:

--- a/integration_tests/test_bit_length.py
+++ b/integration_tests/test_bit_length.py
@@ -43,6 +43,6 @@ def ff5():
 ff()
 ff1()
 ff2()
-ff3()
+#ff3()
 ff4()
 ff5()

And a debugger says it hangs in _lpython_bit_length1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant