Skip to content
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

isinf() causes problem #165

Open
dvarrazzo opened this issue Jan 21, 2019 · 0 comments
Open

isinf() causes problem #165

dvarrazzo opened this issue Jan 21, 2019 · 0 comments

Comments

@dvarrazzo
Copy link
Contributor

The function:

static PyObject *
pfloat_getquoted(pfloatObject *self, PyObject *args)
{
    PyObject *rv;
    double n = 3.14;
    if (isnan(n))
        rv = PyString_FromString("'NaN'::float");
    else if (isinf(n)) {
        if (n > 0)
            rv = PyString_FromString("'Infinity'::float");
        else
            rv = PyString_FromString("'-Infinity'::float");
    }
    else {
        rv = Py_None;
        Py_INCREF(rv);
    }

exit:
    return rv;
}

crashes the checker with the following traceback:

psycopg/adapter_pfloat.c:45:14: error: Unhandled Python exception raised calling 'execute' method
     else if (isinf(n)) {
              ^
Traceback (most recent call last):
  File "/home/piro/dev/fs/gcc-python-plugin/libcpychecker/__init__.py", line 95, in execute
    self._check_refcounts(fun)
  File "/home/piro/dev/fs/gcc-python-plugin/libcpychecker/__init__.py", line 101, in _check_refcounts
    dump_json=self.dump_json)
  File "/home/piro/dev/fs/gcc-python-plugin/libcpychecker/refcounts.py", line 4414, in check_refcounts
    maxtrans)
  File "/home/piro/dev/fs/gcc-python-plugin/libcpychecker/refcounts.py", line 4267, in impl_check_refcounts
    limits=limits)
  File "/home/piro/dev/fs/gcc-python-plugin/libcpychecker/absinterp.py", line 3047, in iter_traces
    depth + 1):
  File "/home/piro/dev/fs/gcc-python-plugin/libcpychecker/absinterp.py", line 3047, in iter_traces
    depth + 1):
  File "/home/piro/dev/fs/gcc-python-plugin/libcpychecker/absinterp.py", line 3047, in iter_traces
    depth + 1):
  File "/home/piro/dev/fs/gcc-python-plugin/libcpychecker/absinterp.py", line 3047, in iter_traces
    depth + 1):
  File "/home/piro/dev/fs/gcc-python-plugin/libcpychecker/absinterp.py", line 3011, in iter_traces
    transitions = curstate.get_transitions()
  File "/home/piro/dev/fs/gcc-python-plugin/libcpychecker/absinterp.py", line 2049, in get_transitions
    return self._get_transitions_for_stmt(stmt)
  File "/home/piro/dev/fs/gcc-python-plugin/libcpychecker/absinterp.py", line 2076, in _get_transitions_for_stmt
    return self._get_transitions_for_GimpleAssign(stmt)
  File "/home/piro/dev/fs/gcc-python-plugin/libcpychecker/absinterp.py", line 2595, in _get_transitions_for_GimpleAssign
    value = self.eval_rhs(stmt)
  File "/home/piro/dev/fs/gcc-python-plugin/libcpychecker/absinterp.py", line 2587, in eval_rhs
    % (stmt.exprcode, stmt.exprcode, stmt.loc))
NotImplementedError: Don't know how to cope with exprcode: <type 'gcc.UnleExpr'> (<type 'gcc.UnleExpr'>) at psycopg/adapter_pfloat.c:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant