Skip to content

Commit

Permalink
Stacks grow downward on x86_64
Browse files Browse the repository at this point in the history
I exchanged [rbp-0x20] with [rbp+0x20], making the JIT write the
frame number outside its stack space. On OSX, this caused a crash,
but unfortunately it was masked by alignment on linux/windows and
under debuggers.
  • Loading branch information
Bart Wiegmans authored and Bart Wiegmans committed May 13, 2016
1 parent 5d854b2 commit b4d1dc6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/jit/emit_x64.dasc
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ const unsigned int MVM_jit_num_globals(void) {
| callp &MVM_exception_throw_adhoc;
|.endmacro

|.define FRAME_NR, dword [rbp+0x20]
|.define FRAME_NR, dword [rbp-0x20]

/* A function prologue is always the same in x86 / x64, because
* we do not provide variable arguments, instead arguments are provided
Expand Down

0 comments on commit b4d1dc6

Please sign in to comment.