]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: repair ssa/debug_test regression
authorDavid Chase <drchase@google.com>
Wed, 27 Mar 2019 20:15:04 +0000 (16:15 -0400)
committerDavid Chase <drchase@google.com>
Thu, 28 Mar 2019 00:29:48 +0000 (00:29 +0000)
Code introduced in

[2034fbab5b1d11bc59cb476bc3f49ee1b344839d]
cmd/compile: use existing instructions instead of nops for inline marks

to change a src.Pos's column to 1 accidentally reset
the is_stmt and prologue/epilogue bits, and that
turned out to cause a regression in ssa/debug_test.

Preserving that information fixed the regression.

Change-Id: I7c6859c8b68d9c6f7c0cbc8805c1f41dc5c1d5fb
Reviewed-on: https://go-review.googlesource.com/c/go/+/169739
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
src/cmd/internal/src/pos.go

index 8344a5a612577076c6a6bd71cb352aa086e79728..954c00716f89f3759902430aa5e868009eb4d0e3 100644 (file)
@@ -311,7 +311,9 @@ const (
        colBits, colMax       = 32 - lineBits - xlogueBits - isStmtBits, 1<<colBits - 1
 
        isStmtShift = 0
+       isStmtMask  = isStmtMax << isStmtShift
        xlogueShift = isStmtBits + isStmtShift
+       xlogueMask  = xlogueMax << xlogueShift
        colShift    = xlogueBits + xlogueShift
        lineShift   = colBits + colShift
 )
@@ -443,5 +445,5 @@ func (x lico) lineNumberHTML() string {
 }
 
 func (x lico) atColumn1() lico {
-       return makeLico(x.Line(), 1)
+       return makeLico(x.Line(), 1) | (x & (isStmtMask | xlogueMask))
 }