|
From: xinran w. <xin...@gm...> - 2009-02-28 20:16:00
|
Hi,
I tried to pass the condition value of IRExpr Iex_Mux0X to a helper
function, but failed with following errors:
vex: priv/host-x86/isel.c:530 (doHelperCall): Assertion
`typeOfIRExpr(env->type_env, args[i]) == Ity_I32' failed.
vex storage: T total 9484900 bytes allocated
vex storage: P total 576 bytes allocated
valgrind: the 'impossible' happened:
LibVEX called failure_exit().
==24283== at 0x3800AFAD: report_and_quit (m_libcassert.c:140)
==24283== by 0x3800B0BB: panic (m_libcassert.c:210)
==24283== by 0x3800B152: vgPlain_core_panic_at (m_libcassert.c:215)
==24283== by 0x3800B190: vgPlain_core_panic (m_libcassert.c:220)
==24283== by 0x3801D8B6: failure_exit (m_translate.c:588)
==24283== by 0x3807F433: vex_assert_fail (vex_util.c:220)
==24283== by 0x38096DBF: doHelperCall (isel.c:530)
==24283== by 0x3809C0ED: iselSB_X86 (isel.c:3809)
==24283== by 0x3807DD69: LibVEX_Translate (vex_main.c:570)
==24283== by 0x3801C1CE: vgPlain_translate (m_translate.c:1417)
==24283== by 0x38025C7F: vgPlain_scheduler (scheduler.c:762)
==24283== by 0x3803A108: run_a_thread_NORETURN (syswrap-linux.c:89)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Here is my helper function:
static VG_REGPARM(3) void mux0x_handler0(Bool cond, IRTemp doffset,
IRTemp cond_var)
{
tl_assert(cond_var <=MAX_TEMP_MAP);
tl_assert(doffset <=MAX_TEMP_MAP);
temp_map.v[doffset] = 0;
}
with instrument code:
case Iex_Mux0X:
cond = data->Iex.Mux0X.cond; /* Condition */
expr0 = data->Iex.Mux0X.expr0; /* True expression */
exprX = data->Iex.Mux0X.exprX; /* False expression */
tl_assert(cond->tag == Iex_RdTmp);
tmp1 = cond->Iex.RdTmp.tmp;
if (exprX->tag == Iex_RdTmp && expr0->tag == Iex_RdTmp ) {
tmp2 = expr0->Iex.RdTmp.tmp;
tmp3 = exprX->Iex.RdTmp.tmp;
argv = mkIRExprVec_4( cond, mkIRExpr_HWord(
st->Ist.WrTmp.tmp ),
mkIRExpr_HWord(tmp2),mkIRExpr_HWord(tmp3) );
di = unsafeIRDirty_0_N( 0,
"mux0x_handler3",
VG_(fnptr_to_fnentry)( mux0x_handler3 ),
argv );
}
addStmtToIRSB( sbOut, IRStmt_Dirty(di) );
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Also tried to pass args in stack, but failed either with the following errors.
vex: the `impossible' happened:
pushArg(x86): can't handle arg of this type
vex storage: T total 9484900 bytes allocated
vex storage: P total 576 bytes allocated
valgrind: the 'impossible' happened:
LibVEX called failure_exit().
==23569== at 0x3800AFAD: report_and_quit (m_libcassert.c:140)
==23569== by 0x3800B0BB: panic (m_libcassert.c:210)
==23569== by 0x3800B152: vgPlain_core_panic_at (m_libcassert.c:215)
==23569== by 0x3800B190: vgPlain_core_panic (m_libcassert.c:220)
==23569== by 0x3801D8B6: failure_exit (m_translate.c:588)
==23569== by 0x3807F3FE: vpanic (vex_util.c:227)
==23569== by 0x38096D70: doHelperCall (isel.c:353)
==23569== by 0x3809C0ED: iselSB_X86 (isel.c:3809)
==23569== by 0x3807DD69: LibVEX_Translate (vex_main.c:570)
==23569== by 0x3801C1CE: vgPlain_translate (m_translate.c:1417)
==23569== by 0x38025C7F: vgPlain_scheduler (scheduler.c:762)
==23569== by 0x3803A108: run_a_thread_NORETURN (syswrap-linux.c:89)
~~~~~~~~~~~~~~~~~~~~~``
Really appreciate your help. Thank you very much.
-Xinran
|