diff options
| -rw-r--r-- | pkg/lang/vm/text/compiler.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/pkg/lang/vm/text/compiler.go b/pkg/lang/vm/text/compiler.go index 28bc9a7..21d8dae 100644 --- a/pkg/lang/vm/text/compiler.go +++ b/pkg/lang/vm/text/compiler.go @@ -194,7 +194,11 @@ func (cpl *Compiler) linkLabels(builder *code.Builder) error { for _, ref := range cpl.labelReferences { pos, ok := cpl.labelPositions[ref.label] if !ok { - return ErrUnkonwnLabel{ref.label} + if pc, err := strconv.ParseUint(ref.label, 10, 64); err == nil { + pos = int(pc) + } else { + return ErrUnkonwnLabel{ref.label} + } } builder.SetInt(ref.at, int64(pos)) |
