[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Lightning] Bus error on OSX

From: Mathieu Suen
Subject: [Lightning] Bus error on OSX
Date: Sun, 27 Jun 2010 21:20:05 +0200


I tried the example from the documentation on OSX.
But when I run it I got a "Bus error".

#include <lightning.h>
#include <stdio.h>

static jit_insn codeBuffer[1024];
typedef int (*pifi)(int);

int main ()
        pifi  incr = (pifi) (jit_set_ip(codeBuffer).iptr);
        int   in;
        jit_leaf(1);                     /*      leaf  1             */
        in = jit_arg_i();                /* in = arg_i               */
        jit_getarg_i(JIT_R0, in);        /*      getarg_i R0         */
        jit_addi_i(JIT_RET, JIT_R0, 1);  /*      addi_i   RET, R0, 1 */
        jit_ret();                       /*      ret                 */
        jit_flush_code(codeBuffer, jit_get_ip().ptr);
        /* call the generated code, passing 5 as an argument */
        printf("%d + 1 = %d\n", 5, incr(5));
        return 0;


I guess I am not getting the right instruction since I have no compile error.
So I force 32 bit compilation and it work.

Is there no support for x86-64 architecture?



Yahoo! Mail réinvente le mail ! Découvrez le nouveau Yahoo! Mail et son 
interface révolutionnaire.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]