detached 5e664bd

fix: bound 32-bit syscall arg setup

commit
5e664bd0caadb3bbb7dd07a6bdc29feff456f027
author
brice · · 2026-04-13 09:58 UTC
parent
c0e6605
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
2 files · +16 -18
M syscall_32bit.go +0 -18
@@ -41,23 +41,6 @@ func (s *syscall15Args) Set(fn uintptr, ints []uintptr, floats []uintptr, r8 uin
4141 s.a13 = ints[12]
4242 s.a14 = ints[13]
4343 s.a15 = ints[14]
44- s.a16 = ints[15]
45- s.a17 = ints[16]
46- s.a18 = ints[17]
47- s.a19 = ints[18]
48- s.a20 = ints[19]
49- s.a21 = ints[20]
50- s.a22 = ints[21]
51- s.a23 = ints[22]
52- s.a24 = ints[23]
53- s.a25 = ints[24]
54- s.a26 = ints[25]
55- s.a27 = ints[26]
56- s.a28 = ints[27]
57- s.a29 = ints[28]
58- s.a30 = ints[29]
59- s.a31 = ints[30]
60- s.a32 = ints[31]
6144 s.f1 = floats[0]
6245 s.f2 = floats[1]
6346 s.f3 = floats[2]
@@ -73,7 +56,6 @@ func (s *syscall15Args) Set(fn uintptr, ints []uintptr, floats []uintptr, r8 uin
7356 s.f13 = floats[12]
7457 s.f14 = floats[13]
7558 s.f15 = floats[14]
76- s.f16 = floats[15]
7759 s.arm64_r8 = r8
7860 }
7961
@@ -41,23 +41,6 @@ func (s *syscall15Args) Set(fn uintptr, ints []uintptr, floats []uintptr, r8 uin
41 s.a13 = ints[12]41 s.a13 = ints[12]
42 s.a14 = ints[13]42 s.a14 = ints[13]
43 s.a15 = ints[14]43 s.a15 = ints[14]
44- s.a16 = ints[15]
45- s.a17 = ints[16]
46- s.a18 = ints[17]
47- s.a19 = ints[18]
48- s.a20 = ints[19]
49- s.a21 = ints[20]
50- s.a22 = ints[21]
51- s.a23 = ints[22]
52- s.a24 = ints[23]
53- s.a25 = ints[24]
54- s.a26 = ints[25]
55- s.a27 = ints[26]
56- s.a28 = ints[27]
57- s.a29 = ints[28]
58- s.a30 = ints[29]
59- s.a31 = ints[30]
60- s.a32 = ints[31]
61 s.f1 = floats[0]44 s.f1 = floats[0]
62 s.f2 = floats[1]45 s.f2 = floats[1]
63 s.f3 = floats[2]46 s.f3 = floats[2]
@@ -73,7 +56,6 @@ func (s *syscall15Args) Set(fn uintptr, ints []uintptr, floats []uintptr, r8 uin
73 s.f13 = floats[12]56 s.f13 = floats[12]
74 s.f14 = floats[13]57 s.f14 = floats[13]
75 s.f15 = floats[14]58 s.f15 = floats[14]
76- s.f16 = floats[15]
77 s.arm64_r8 = r859 s.arm64_r8 = r8
78 }60 }
79 61
A syscall_32bit_internal_test.go +16 -0
@@ -0,0 +1,16 @@
1+//go:build (386 || arm) && (freebsd || linux || netbsd || windows)
2+
3+package purego
4+
5+import "testing"
6+
7+func TestSyscall15ArgsSetDoesNotPanicWithMaxArgs(t *testing.T) {
8+ defer func() {
9+ if r := recover(); r != nil {
10+ t.Fatalf("Set panicked: %v", r)
11+ }
12+ }()
13+
14+ var s syscall15Args
15+ s.Set(1, make([]uintptr, maxArgs), make([]uintptr, maxArgs), 8)
16+}
@@ -0,0 +1,16 @@
1+//go:build (386 || arm) && (freebsd || linux || netbsd || windows)
2+
3+package purego
4+
5+import "testing"
6+
7+func TestSyscall15ArgsSetDoesNotPanicWithMaxArgs(t *testing.T) {
8+ defer func() {
9+ if r := recover(); r != nil {
10+ t.Fatalf("Set panicked: %v", r)
11+ }
12+ }()
13+
14+ var s syscall15Args
15+ s.Set(1, make([]uintptr, maxArgs), make([]uintptr, maxArgs), 8)
16+}

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