0xPolygonMiden / compiler

Compiler from MidenIR to Miden Assembly
MIT License
64 stars 22 forks source link

Hitting the "expected switch instructions to have been rewritten before stackification" panic in `BlockEmitter::emit_inst`when compiling rust enum #281

Open greenhat opened 2 months ago

greenhat commented 2 months ago

Hitting panic in the BlockEmitter::emit_inst https://github.com/0xPolygonMiden/compiler/blob/c2053e6b6f568486df7a05498a89f8c51d586a64/codegen/masm/src/codegen/emitter.rs#L246-L248

How to reproduce:

https://github.com/0xPolygonMiden/compiler/blob/2ccdf23fa606ef0ba29f734394ad7dae6ff566a6/tests/integration/src/rust_masm_tests/types.rs#L11

bitwalker commented 2 months ago

Hmm, looks like we never actually lower these to a chain of if/then/else in our pipeline. I'll add this to my TODO for the IR refactoring