Added label type
This commit is contained in:
@ -8,8 +8,8 @@ import (
|
||||
// CompileAssert compiles an assertion.
|
||||
func (f *Function) CompileAssert(assert *ast.Assert) error {
|
||||
f.count.assert++
|
||||
success := f.CreateLabel("assert true", f.count.assert)
|
||||
fail := f.CreateLabel("assert false", f.count.assert)
|
||||
success := f.CreateLabel("assert true", f.count.assert, asm.ControlLabel)
|
||||
fail := f.CreateLabel("assert false", f.count.assert, asm.ControlLabel)
|
||||
err := f.CompileCondition(assert.Condition, success, fail)
|
||||
|
||||
if err != nil {
|
||||
@ -20,7 +20,7 @@ func (f *Function) CompileAssert(assert *ast.Assert) error {
|
||||
|
||||
f.Defer(func() {
|
||||
f.AddLabel(fail)
|
||||
f.Jump(asm.JUMP, "_crash")
|
||||
f.Jump(asm.JUMP, asm.Label{Name: "_crash", Type: asm.ControlLabel})
|
||||
})
|
||||
|
||||
return err
|
||||
|
Reference in New Issue
Block a user