()
| 173 | } |
| 174 | |
| 175 | func (p *program) finalize() (asm.Instructions, error) { |
| 176 | if p.hasWildCard { |
| 177 | // acceptBlock with asm.Return() is already inserted |
| 178 | return p.insts, nil |
| 179 | } |
| 180 | blockSym := fmt.Sprintf("block-%d", p.blockID) |
| 181 | p.insts = append(p.insts, |
| 182 | // R0 <- 0 |
| 183 | asm.Mov.Imm32(asm.R0, 0).WithSymbol(blockSym), |
| 184 | asm.Return(), |
| 185 | ) |
| 186 | p.blockID = -1 |
| 187 | return p.insts, nil |
| 188 | } |
| 189 | |
| 190 | func acceptBlock(accept bool) asm.Instructions { |
| 191 | v := int32(0) |