hlorenzi / customasm

💻 An assembler for custom, user-defined instruction sets! https://hlorenzi.github.io/customasm/web/
Apache License 2.0
704 stars 55 forks source link

#subruledef in #if causes rust to panic #171

Closed chrisgbk closed 1 year ago

chrisgbk commented 1 year ago
X=1
#if X==1
{
#subruledef test
    {
        {a: i32} => a
    }
}
#else
{
    #subruledef test
    {
        {a: i16} => a
    }
}

#ruledef
{
    test {X: test} => X
}
thread 'main' panicked at 'insertion index (is 1) should be <= len (is 0)', library\alloc\src\vec\mod.rs:1439:13
stack backtrace:
   0: rust_begin_unwind
             at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library\std\src/panicking.rs:578:5
   1: core::panicking::panic_fmt
             at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library\core\src/panicking.rs:67:14
   2: alloc::vec::Vec<T,A>::insert::assert_failed
             at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library\alloc\src\vec/mod.rs:1439:13
   3: customasm::asm::defs::define_remaining
   4: customasm::asm::assemble
   5: customasm::driver::drive_from_commandline
   6: customasm::main