Skip to content

Commit

Permalink
Add compile-time platform check for JIT support
Browse files Browse the repository at this point in the history
In issue #324, bus errors are reported when MoarVM is compiled
in a universal binary and runs on a 32 bit platform (OS X).
This adds a compile-time check for the platform, in the assumption
that the compiler will generate different code for each 'instance',
in which case it should disable the JIT support on 32 bit platforms.
  • Loading branch information
bdw committed Jan 18, 2016
1 parent eefa8ec commit 6ae4e7f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/jit/emit_x64.dasc
Expand Up @@ -61,7 +61,15 @@


const MVMint32 MVM_jit_support(void) {
#ifdef __i386__
/* Usually, this file should only be compiled only on a amd64
platform; but when compiling 'fat' or 'universal' binaries, we
may compile it for other platform. In this case we use the
runtime check to disable the JIT */
return 0;
#else
return 1;
#endif
}

const unsigned char * MVM_jit_actions(void) {
Expand Down

0 comments on commit 6ae4e7f

Please sign in to comment.