Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/buildcommit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ jobs:
path: lib/${{ matrix.abi }}/libstackman.a

build-windows:
runs-on: windows-latest
runs-on: windows-2022
strategy:
matrix:
platform: [x86, x64, arm64]
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Changed
- CI: pinned Windows runner to `windows-2022` (from `windows-latest`) to keep VS2022 v143 toolset availability stable for ARM64 builds

Comment on lines +8 to +12
### Fixed
- Fixed amd64 (sysv_x86_64 GCC) restore callback stack-pointer argument to pass the active switched stack pointer
- Added assertion coverage in `tests/test.c` to detect incorrect restore callback stack pointer on amd64

## [1.2.0] - 2025-11-16

### Added
Expand Down
2 changes: 1 addition & 1 deletion stackman/platforms/switch_x86_64_gcc.S
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ LABEL(stackman_switch)
addq %rax, %rbp
# 0 "" 2
#NO_APP
movq %rbx, %rdx
movq %rsp, %rdx
movl $1, %esi
movq %r15, %rdi
call *%r14
Expand Down
2 changes: 1 addition & 1 deletion stackman/platforms/switch_x86_64_gcc.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ void *STACKMAN_SWITCH_INASM_NAME(stackman_cb_t callback, void *context)
__asm__ ("movq %[result], %%rsp" :: [result] "r" (stack_pointer2));
__asm__ ("addq %[arg], %%rbp" :: [arg] "r" (diff));

stack_pointer = callback(context, STACKMAN_OP_RESTORE, stack_pointer);
stack_pointer = callback(context, STACKMAN_OP_RESTORE, stack_pointer2);
/* restore non-volatile registers from stack */
__asm__ volatile (
"ldmxcsr %[sr]\n\t"
Expand Down
2 changes: 2 additions & 0 deletions tests/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ void *jmp_cb(void* context, int opcode, void *sp)
if (opcode == (int)STACKMAN_OP_SAVE) {
return c->stack_near;
} else {
/* RESTORE must receive the active switched stack pointer. */
assert(sp == c->stack_near);
restore_stack(c->stack_near, c->buf, c->size);
return sp;
}
Expand Down