Open
Description
I am trying to compile and run the generated C code from integrations/test_math.py
. LPython generates the code successfully but running the generated code after compilation gives a Segmentation fault. Debugging more into this found the following issue:
The generated code contains:
double log(double x)
{
double _lpython_return_variable;
_lpython_return_variable = _lfortran_dlog(x);
return _lpython_return_variable;
}
And the _lfortran_dlog
in lfortran_intrinsincs.c
also uses a function log
from math.h
LFORTRAN_API double _lfortran_dlog(double x)
{
return log(x);
}
I suppose there is an infinite loop of function calls between these functions and hence may lead to a segmentation fault.