Weird problem
Dibyendu Majumdar
mobile@majumdar.org.uk
Thu Jan 1 00:00:00 GMT 2015
Hi Dave,
I am trying to debug a problem I am having with one piece of code.
The generated code (snippet) is shown below:
double OP_RAVI_TOFLT_n_2_8;
bool comparison_0_12;
comparison_0_12 = luaV_tonumber_ (&base[(int)0],
&OP_RAVI_TOFLT_n_2_8) == (int)0;
if (comparison_0_12) goto OP_RAVI_TOFLT_if_conversion_failed_2_13;
else goto OP_RAVI_TOFLT_if_conversion_ok_2_14;
OP_RAVI_TOFLT_if_conversion_ok_2_14:
(void)printf ("number ok = %f\
", OP_RAVI_TOFLT_n_2_8);
The printf output says that value of OP_RAVI_TOFLT_n_2_8 is 0.0.
Yet the called function luaV_tonumber_() set this to a different value:
Output from luaV_tonumber_():
set *0x7ffe1bb8d298 to 5.600000
Output from JIT code above:
number ok = 0.000000
>From the dump it seems that the address of the local variable
OP_RAVI_TOFLT_n_2_8 is being passed to the function. And yet the value
of the variable is its original value which was 0.0.
Any tips on what I should be looking for?
Thanks and Regards
Dibyendu
More information about the Jit
mailing list