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

LLVM backend panic when comparing array of strings with empty string literal #4873

Open
FourteenBrush opened this issue Feb 23, 2025 · 3 comments · May be fixed by #4876
Open

LLVM backend panic when comparing array of strings with empty string literal #4873

FourteenBrush opened this issue Feb 23, 2025 · 3 comments · May be fixed by #4876

Comments

@FourteenBrush
Copy link
Contributor

Context

Odin:    dev-2025-02
OS:      NixOS 25.05 (Warbler), Linux 6.6.71
CPU:     AMD Ryzen 7 5800H with Radeon Graphics         
RAM:     15847 MiB
Backend: LLVM 18.1.8

Current Behavior

package test

main :: proc() {
    x: [4]string
    if x == "" {}
}

src/llvm_backend_expr.cpp(3195): Panic: Unknown handled type: [4]string -> [4]string

This does not happen when using anything else than an empty string literal

Failure Information (for bugs)

Relevant gdb output:

src/llvm_backend_expr.cpp(3195): Panic: Unknown handled type: [4]string -> [4]string

Thread 13 ".odin-wrapped" received signal SIGILL, Illegal instruction.
[Switching to Thread 0x7fffe86a56c0 (LWP 759814)]
0x000055555570489e in lb_emit_comp_against_nil(lbProcedure*, TokenKind, lbValue) ()
(gdb) 

Steps to Reproduce

Use the above code, and attempt to build it with odin build main.odin -file

@rezwanahmedsami
Copy link

ok , let me check on that

rezwanahmedsami added a commit to rezwanahmedsami/Odin that referenced this issue Feb 24, 2025
@rezwanahmedsami rezwanahmedsami linked a pull request Feb 24, 2025 that will close this issue
@rezwanahmedsami
Copy link

Context

Odin:    dev-2025-02
OS:      NixOS 25.05 (Warbler), Linux 6.6.71
CPU:     AMD Ryzen 7 5800H with Radeon Graphics         
RAM:     15847 MiB
Backend: LLVM 18.1.8

Current Behavior

package test

main :: proc() {
x: [4]string
if x == "" {}
}

src/llvm_backend_expr.cpp(3195): Panic: Unknown handled type: [4]string -> [4]string

This does not happen when using anything else than an empty string literal

Failure Information (for bugs)

Relevant gdb output:

src/llvm_backend_expr.cpp(3195): Panic: Unknown handled type: [4]string -> [4]string

Thread 13 ".odin-wrapped" received signal SIGILL, Illegal instruction.
[Switching to Thread 0x7fffe86a56c0 (LWP 759814)]
0x000055555570489e in lb_emit_comp_against_nil(lbProcedure*, TokenKind, lbValue) ()
(gdb) 

Steps to Reproduce

Use the above code, and attempt to build it with odin build main.odin -file

This issue has been solved: #4876

@rezwanahmedsami
Copy link

@gingerBill check this please

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

Successfully merging a pull request may close this issue.

2 participants