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

Segmentation Fault when Assigning Mixed Data Types in If-Else-Construct #916

Open
Garic152 opened this issue Nov 15, 2024 · 1 comment
Open

Comments

@Garic152
Copy link
Contributor

Description

When assigning different datatypes in the ifelse statement, we receive a segfault instead of attempting to promote one of the 2 types or throwing a compilation error.

Steps to Reproduce

Here is a minimal example to reproduce the issue:

a = 1 == 1 ? 1 : 0.0;
print(a);
@philipportner
Copy link
Collaborator

Hi @Garic152 ,
for me on the current HEAD, this doesn't segfault. Instead it throws an exception from here.

CanonicalizerPass (mlir::daphne::CondOp) failed with the following message [ the then/else-values of CondOp must have the same value type ]
    | Source file -> "/home/philipportner/daphne/tmp.daphne":1:4
    |
  1 | a = 1 == 1 ? 1 : 0.0;
    |     ^~~

Seems like currently matching types are a requirement for the CondOp, but different types could be something that we should support.

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

2 participants