detached 382f4c6

use R10 instead of R12 (#61)

on x86-64 R12 is callee-saved which means if we use it in callbackasm1 we MUST preserve its value. We were not doing that so it caused the SIGSEGV to happen in Oto. I replaced R12 with R10 because R10 is caller-saved so we don't need to worry about throwing away the value inside of it.

Closes #60
commit
382f4c69b85482e885511dd001710fd145469a76
author
TotallyGamerJet · · 2022-11-07 04:01 UTC
committer
GitHub · · 2022-11-07 04:01 UTC
parent
13a6f78
signature
GPG Unverified4AEE18F83AFDEB23 The key is unknown
1 file · +4 -4
M sys_darwin_amd64.s +4 -4
@@ -84,7 +84,7 @@ TEXT callbackasm1(SB), NOSPLIT, $0
8484 MOVQ 0(SP), AX
8585 ADDQ $8, SP
8686
87- MOVQ 0(SP), R12 // get the return SP so that we can align register args with stack args
87+ MOVQ 0(SP), R10 // get the return SP so that we can align register args with stack args
8888
8989 // make space for first six arguments below the frame
9090 ADJSP $6*8, SP
@@ -96,7 +96,7 @@ TEXT callbackasm1(SB), NOSPLIT, $0
9696 MOVQ R9, 48(SP)
9797 LEAQ 8(SP), R8 // R8 = address of args vector
9898
99- MOVQ R12, 0(SP) // push the stack pointer below registers
99+ MOVQ R10, 0(SP) // push the stack pointer below registers
100100
101101 // determine index into runtime·cbs table
102102 MOVQ $callbackasm(SB), DX
@@ -131,10 +131,10 @@ TEXT callbackasm1(SB), NOSPLIT, $0
131131
132132 POP_REGS_HOST_TO_ABI0()
133133
134- MOVQ 0(SP), R12 // get the SP back
134+ MOVQ 0(SP), R10 // get the SP back
135135
136136 ADJSP $-6*8, SP // remove arguments
137137
138- MOVQ R12, 0(SP)
138+ MOVQ R10, 0(SP)
139139
140140 RET
@@ -84,7 +84,7 @@ TEXT callbackasm1(SB), NOSPLIT, $0
84 MOVQ 0(SP), AX84 MOVQ 0(SP), AX
85 ADDQ $8, SP85 ADDQ $8, SP
86 86
87- MOVQ 0(SP), R12 // get the return SP so that we can align register args with stack args87+ MOVQ 0(SP), R10 // get the return SP so that we can align register args with stack args
88 88
89 // make space for first six arguments below the frame89 // make space for first six arguments below the frame
90 ADJSP $6*8, SP90 ADJSP $6*8, SP
@@ -96,7 +96,7 @@ TEXT callbackasm1(SB), NOSPLIT, $0
96 MOVQ R9, 48(SP)96 MOVQ R9, 48(SP)
97 LEAQ 8(SP), R8 // R8 = address of args vector97 LEAQ 8(SP), R8 // R8 = address of args vector
98 98
99- MOVQ R12, 0(SP) // push the stack pointer below registers99+ MOVQ R10, 0(SP) // push the stack pointer below registers
100 100
101 // determine index into runtime·cbs table101 // determine index into runtime·cbs table
102 MOVQ $callbackasm(SB), DX102 MOVQ $callbackasm(SB), DX
@@ -131,10 +131,10 @@ TEXT callbackasm1(SB), NOSPLIT, $0
131 131
132 POP_REGS_HOST_TO_ABI0()132 POP_REGS_HOST_TO_ABI0()
133 133
134- MOVQ 0(SP), R12 // get the SP back134+ MOVQ 0(SP), R10 // get the SP back
135 135
136 ADJSP $-6*8, SP // remove arguments136 ADJSP $-6*8, SP // remove arguments
137 137
138- MOVQ R12, 0(SP)138+ MOVQ R10, 0(SP)
139 139
140 RET140 RET

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 102

↑↓ moveenter openesc close