Skip to content

GCC crash with C functions in conditional expression. #3418

@will-ca

Description

@will-ca

.py

def dynfuncswitch(val, preferleft=True):
	"""Causes gcc crash."""
	return (math.floor if preferleft else math.ceil)(val)

.pxd

from libc cimport math

The above code is valid Python, and it Cythonizes fine, but it causes a crash in gcc. Typing the arguments and return of the function does not change the behaviour.

error: assignment of function ‘double __pyx_t_1(double)’
19498 |     __pyx_t_1 = floor

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions