Closed
Description
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
.