[Issue 24881] New: ICE on attempt to compare deref of two functions ptr

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Nov 25 19:35:44 UTC 2024


https://issues.dlang.org/show_bug.cgi?id=24881

          Issue ID: 24881
           Summary: ICE on attempt to compare deref of two functions ptr
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Keywords: accepts-invalid, ice
          Severity: critical
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: b2.temp at gmx.com

The following input

```
void function(int) a;
void function(int) b;

void main()
{
    const c = *a == *b;
    // assert(*a); // rejected during sema
}     
```

crashes dmd in the backend:

> TYD func
> 
> Program received signal SIGILL, Illegal instruction.
> 0x00005555559d1756 in dmd.backend.cod3.jmpopcode(dmd.backend.el.elem*) ()

I think however that the program is semantically invalid and should be rejected
during exp-semantics, just like the commented assertion is.

--


More information about the Digitalmars-d-bugs mailing list