-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I definitely merged wrong because two tests don't pass
- Loading branch information
Showing
20 changed files
with
269 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
section .data | ||
align_error db "x86istimb integrity error: stack was not 16-byte aligned at function exit (right before prologue)", 0 | ||
|
||
section .text | ||
global _x86istmb_Nruntime_Scheck_stack_alignment | ||
extern _puts | ||
extern _exit | ||
|
||
_x86istmb_Nruntime_Scheck_stack_alignment: | ||
push rdi | ||
push rsi | ||
|
||
; if stack was not 16 byte aligned, this was called, so the call instruction pushes on the stack | ||
; therefore we WILL be 16 byte aligned | ||
mov rdi, rsp | ||
and rdi, 0xF | ||
jnz .stack_aligned | ||
|
||
; otherwise fail | ||
sub rsp, 8 ; to actually make stack aligned | ||
lea rdi, [rel align_error] | ||
call _puts | ||
mov edi, 1 | ||
call _exit | ||
|
||
.stack_aligned: | ||
pop rsi | ||
pop rdi | ||
ret |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
namespace std { | ||
namespace math { | ||
func inc(x: Int) -> Int { | ||
return x + 1 | ||
} | ||
|
||
func add(x: Int, y: Int) -> Int { | ||
return x + y | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.