Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
17 changes: 15 additions & 2 deletions .github/workflows/binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,20 @@ jobs:
run: cd nasm && make test_mains
- name: linkable binary
run: cd nasm && make bin && ./linkable_binary.out
test-macos:
test-macos-xcode_15_2-intel:

runs-on: macos-13

steps:
- uses: actions/checkout@v4
- name: add nasm
run: brew install nasm
- name: Run tests
run: cd nasm && make test_mains
# binary segfaults on macos catalina without 16-byte-alignment for syscalls (stack_not_16_byte_aligned_error)
- name: linkable binary
run: cd nasm && make bin && ./linkable_binary.out
test-macos-xcode_16-emulated:

runs-on: macos-15

Expand All @@ -35,6 +48,6 @@ jobs:
run: brew install nasm
- name: Run tests
run: cd nasm && make test_mains
# binary segfaults on gha macos (arm64) when not specifying macos-15
# binary segfaults on gha arm64 when not running with macos-14/latest
- name: linkable binary
run: cd nasm && make bin && ./linkable_binary.out
4 changes: 4 additions & 0 deletions nasm/linked_list/ft_linked_list.s
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ SYM(ft_create_elem):
enter 0, 0
push rdi
mov rdi, ELEM_SIZE
sub rsp, 8
call SYM_SYSCALL(malloc)
add rsp, 8
test rax, rax
jz .error_malloc
; rax has 16 bytes
Expand Down Expand Up @@ -170,7 +172,9 @@ SYM(ft_list_remove_if):
mov rdi, [r12]
call [rsp + 8]; free_fct on cur->data
mov rdi, r12; setup: free cur (node)
sub rsp, 8
call SYM_SYSCALL(free)
add rsp, 8
test r13, r13
jz .rmfirst_reset_begin
.rm_nonfirst_update_prev:
Expand Down
2 changes: 2 additions & 0 deletions nasm/strdup/ft_strdup.s
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ SYM(ft_strdup):
inc rax
; call with rax value
mov rdi, rax
sub rsp, 8
call SYM_SYSCALL(malloc)
add rsp, 8
test rax, rax
jz .error_malloc
mov rdi, rax ; provide dest: new allocation
Expand Down