Ticket #906: pir_assign.patch

File pir_assign.patch, 0.7 KB (added by plobsing, 5 years ago)

patch to IMCC to catch assignment syntax for input and inout registers

  • compilers/imcc/imcc.y

     
    568568{ 
    569569    ASSERT_ARGS(func_ins) 
    570570    int i; 
     571    Instruction *ins; 
     572 
    571573    /* shift regs up by 1 */ 
    572574    for (i = n - 1; i >= 0; --i) 
    573575        r[i+1] = r[i]; 
    574576    r[0] = lhs; 
     577 
    575578    /* shift keyvec */ 
    576579    keyv <<= 1; 
    577     return INS(interp, unit, op, "", r, n+1, keyv, emit); 
     580 
     581    ins = INS(interp, unit, op, "", r, n+1, keyv, emit); 
     582 
     583    /* check that 'assigned' register isn't treated as an input by the op */ 
     584    if (ins->flags & 1) 
     585        IMCC_warning(interp, "assignment form used for input argument to `%s'\n", op); 
     586 
     587    return ins; 
    578588} 
    579589 
    580590/*