pass: "instruction should follow a label" info (#115)

Add the label in question to the error message.
This commit is contained in:
Klaus Post
2020-01-13 19:52:16 +01:00
committed by Michael McLoughlin
parent 3c861c7c0b
commit b0ac74488c
2 changed files with 2 additions and 2 deletions

View File

@@ -17,7 +17,7 @@ func LabelTarget(fn *ir.Function) error {
switch n := node.(type) {
case ir.Label:
if pending != empty {
return errors.New("instruction should follow a label")
return fmt.Errorf("expected instruction following label %q", pending)
}
pending = n
if _, found := target[pending]; found {