Thanks to visit codestin.com
Credit goes to github.com

Skip to content

_lpython_bit_length1 fails using conda-forge lpython #1825

Closed
@certik

Description

@certik

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions