|
From: | Paolo Bonzini |
Subject: | Re: [Lightning] Weird bug in function calls |
Date: | Sat, 29 Dec 2007 22:58:12 +0100 |
User-agent: | Thunderbird 2.0.0.9 (Macintosh/20071031) |
Dhaemon wrote:
Hi, First of all, thanks a lot for this great project.I have produced the error on a i686-apple-darwin8 (latest Intel Core Duo 2 Macbook) using Apple GCC 4.0.1 with lightning-1.2b. Function calls seem to work most of the time but sometime they cause an 'Illegal Instruction' error(Unix signal 4).I found a reliable way to reproduce this error at will. It's pretty weird.The following is a slightly modified version of 'printf.c' in the 'tests' directory:http://www.step.polymtl.ca/~polyrad/polyrad/printf.cWhen compiled with the marked c-call to 'display_message', there is no error.
This is wrong: jit_calli(printf); jit_finish(display_message); jit_finish *includes* jit_calli, as in the original printf.c: jit_prepare_i(2); jit_pusharg_i(JIT_R1); /* push in reverse order */ jit_pusharg_p(JIT_R0); jit_finish(display_message);lightning does not support (portably) varargs calls. They might work on some backends but most likely they won't. Currently they only work on i386.
Paolo
[Prev in Thread] | Current Thread | [Next in Thread] |