Rename cgen's break/continue labels

This commit is contained in:
Nigel Tao committed 2020-02-24 14:26:52 +11:00
1 parent 2d2a880c18
commit e6f34fe8a9
3 files changed
+188 -185

No files matched your search

+4 -1
View File
@@ -47,7 +47,10 @@ type funk struct {
hasGotoOK bool
}
func (k *funk) jumpTarget(n a.Loop) (uint32, error) {
func (k *funk) jumpTarget(tm *t.Map, n a.Loop) (interface{}, error) {
if label := n.Label(); label != 0 {
return label.Str(tm), nil
}
if k.jumpTargets == nil {
k.jumpTargets = map[a.Loop]uint32{}
}