]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: repairing variable names and comments
authorDavid Chase <drchase@google.com>
Wed, 22 May 2024 20:15:43 +0000 (16:15 -0400)
committerGopher Robot <gobot@golang.org>
Thu, 23 May 2024 01:05:44 +0000 (01:05 +0000)
Change-Id: I2e775e92dcebf068426b3e2acbe088679c318ec4
Reviewed-on: https://go-review.googlesource.com/c/go/+/587578
Reviewed-by: Keith Randall <khr@golang.org>
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

src/cmd/compile/internal/ir/func.go
src/cmd/compile/internal/rangefunc/rewrite.go

index 328a56c860bcdc50803c360b1d6d1ff05b20bd6e..d0c8ee359befff39c0059ef4540bc063fcc6e939 100644 (file)
@@ -426,20 +426,20 @@ func closureName(outerfn *Func, pos src.XPos, why Op) *types.Sym {
        }
        pkg := types.LocalPkg
        outer := "glob."
-       var prefix string = "."
+       var suffix string = "."
        switch why {
        default:
                base.FatalfAt(pos, "closureName: bad Op: %v", why)
        case OCLOSURE:
                if outerfn == nil || outerfn.OClosure == nil {
-                       prefix = ".func"
+                       suffix = ".func"
                }
        case ORANGE:
-               prefix = "-range"
+               suffix = "-range"
        case OGO:
-               prefix = ".gowrap"
+               suffix = ".gowrap"
        case ODEFER:
-               prefix = ".deferwrap"
+               suffix = ".deferwrap"
        }
        gen := &globClosgen
 
@@ -472,7 +472,7 @@ func closureName(outerfn *Func, pos src.XPos, why Op) *types.Sym {
        }
 
        *gen++
-       return pkg.Lookup(fmt.Sprintf("%s%s%d", outer, prefix, *gen))
+       return pkg.Lookup(fmt.Sprintf("%s%s%d", outer, suffix, *gen))
 }
 
 // NewClosureFunc creates a new Func to represent a function literal
index 8d09782a9eaefb580eb4aec81db49c96aa024982..2dcdc3f018780cffe16302a2c49295c1902f942f 100644 (file)
@@ -160,7 +160,7 @@ The value of #stateK transitions
        if #stateN != abi.RF_READY { runtime.panicrangestate(#stateN) }
        #stateN = abi.RF_PANIC
 
-(4) when loop iteration continues, and
+(4) when loop iteration continues,
 
        #stateN = abi.RF_READY
        [return true]
@@ -447,6 +447,8 @@ becomes
                                        #state3 = abi.RF_READY
                                        return true
                                })
+                               if #state3 == abi.RF_PANIC {runtime.panicrangestate(abi.RF_MISSING_PANIC)}
+                               #state3 = abi.RF_EXHAUSTED
                                if #next < 0 {
                                        #state2 = abi.RF_DONE
                                        return false