Description
Codon aborts while compiling an async program that awaits two coroutines in the same print expression.
Reproduction
import asyncio
async def a():
print("b")
async def b():
print("c")
async def main():
p1 = a()
p2 = b()
print(await p1, await p2)
asyncio.run(main())
Run:
Actual behavior
Invalid InsertValueInst operands!
%31 = insertvalue { {}, {} } undef, ptr %.reload28, 0, !dbg !24057
Invalid InsertValueInst operands!
%29 = insertvalue { {}, {} } undef, ptr %.reload28, 0, !dbg !24070
Invalid InsertValueInst operands!
%29 = insertvalue { {}, {} } undef, ptr %.reload28, 0, !dbg !24083
Assert failed: Generated LLVM IR is invalid and has been dumped to '_dump.ll'. Please submit a bug report at https://github.com/exaloop/codon including the code and generated LLVM IR.
Expression: !broken
Source: /github/workspace/codon/cir/llvm/optimize.cpp:1070
The process aborts with an IOT instruction (core dumped) error.
Expected behavior
The program should run successfully and print:
Environment
- Codon: 0.19.6
- OS: Fedora Linux 43 (Workstation Edition)
- Kernel: Linux 7.0.9-105.fc43.x86_64
- Architecture: x86_64
- CPU: Intel Core Ultra 7 155H
dump.ll.tar.gz
Description
Codon aborts while compiling an async program that awaits two coroutines in the same
printexpression.Reproduction
Run:
Actual behavior
The process aborts with an
IOT instruction (core dumped)error.Expected behavior
The program should run successfully and print:
Environment
dump.ll.tar.gz