Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 53af3c4

Browse files
runtime: add missing //go:nosplit for Windows context methods
1 parent ecf6b52 commit 53af3c4

File tree

4 files changed

+24
-0
lines changed

4 files changed

+24
-0
lines changed

‎src/runtime/defs_windows_386.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,20 @@ type context struct {
4646
extendedregisters [512]uint8
4747
}
4848

49+
//go:nosplit
4950
func (c *context) ip() uintptr { return uintptr(c.eip) }
51+
//go:nosplit
5052
func (c *context) sp() uintptr { return uintptr(c.esp) }
5153

5254
// 386 does not have link register, so this returns 0.
55+
//go:nosplit
5356
func (c *context) lr() uintptr { return 0 }
57+
//go:nosplit
5458
func (c *context) set_lr(x uintptr) {}
5559

60+
//go:nosplit
5661
func (c *context) set_ip(x uintptr) { c.eip = uint32(x) }
62+
//go:nosplit
5763
func (c *context) set_sp(x uintptr) { c.esp = uint32(x) }
5864

5965
func dumpregs(r *context) {

‎src/runtime/defs_windows_amd64.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,20 @@ type context struct {
6060
lastexceptionfromrip uint64
6161
}
6262

63+
//go:nosplit
6364
func (c *context) ip() uintptr { return uintptr(c.rip) }
65+
//go:nosplit
6466
func (c *context) sp() uintptr { return uintptr(c.rsp) }
6567

6668
// AMD64 does not have link register, so this returns 0.
69+
//go:nosplit
6770
func (c *context) lr() uintptr { return 0 }
71+
//go:nosplit
6872
func (c *context) set_lr(x uintptr) {}
6973

74+
//go:nosplit
7075
func (c *context) set_ip(x uintptr) { c.rip = uint64(x) }
76+
//go:nosplit
7177
func (c *context) set_sp(x uintptr) { c.rsp = uint64(x) }
7278

7379
func dumpregs(r *context) {

‎src/runtime/defs_windows_arm.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,18 @@ type context struct {
5050
padding2 [2]uint32
5151
}
5252

53+
//go:nosplit
5354
func (c *context) ip() uintptr { return uintptr(c.pc) }
55+
//go:nosplit
5456
func (c *context) sp() uintptr { return uintptr(c.spr) }
57+
//go:nosplit
5558
func (c *context) lr() uintptr { return uintptr(c.lrr) }
5659

60+
//go:nosplit
5761
func (c *context) set_ip(x uintptr) { c.pc = uint32(x) }
62+
//go:nosplit
5863
func (c *context) set_sp(x uintptr) { c.spr = uint32(x) }
64+
//go:nosplit
5965
func (c *context) set_lr(x uintptr) { c.lrr = uint32(x) }
6066

6167
func dumpregs(r *context) {

‎src/runtime/defs_windows_arm64.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,18 @@ type context struct {
3333
wvr [2]uint64
3434
}
3535

36+
//go:nosplit
3637
func (c *context) ip() uintptr { return uintptr(c.pc) }
38+
//go:nosplit
3739
func (c *context) sp() uintptr { return uintptr(c.xsp) }
40+
//go:nosplit
3841
func (c *context) lr() uintptr { return uintptr(c.x[30]) }
3942

43+
//go:nosplit
4044
func (c *context) set_ip(x uintptr) { c.pc = uint64(x) }
45+
//go:nosplit
4146
func (c *context) set_sp(x uintptr) { c.xsp = uint64(x) }
47+
//go:nosplit
4248
func (c *context) set_lr(x uintptr) { c.x[30] = uint64(x) }
4349

4450
func dumpregs(r *context) {

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /