17 lines
328 B
Go
17 lines
328 B
Go
package asm
|
|
|
|
// CanSkipReturn returns true if the return operation can be skipped.
|
|
func (a *Assembler) CanSkipReturn() bool {
|
|
if len(a.Instructions) == 0 {
|
|
return false
|
|
}
|
|
|
|
lastMnemonic := a.Instructions[len(a.Instructions)-1].Mnemonic
|
|
|
|
if lastMnemonic == RETURN || lastMnemonic == JUMP {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|