|
From: Bart V. A. <bar...@gm...> - 2007-02-26 09:25:03
|
On 2/25/07, Nicholas Nethercote <nj...@cs...> wrote:
> On Sun, 25 Feb 2007, Julian Seward wrote:
>
> >> track_new_mem_stack before the client accesses stack data. Did I
> >> misunderstand something ?
> >
> > Yes (it may not be documented anywhere :-) If the core calls
> > track_new_mem_stack(x) then the new limit below which the client
> > may not go is x - VG_STACK_REDZONE_SZB. Probably you didn't see
> > this on x86 because VG_STACK_REDZONE_SZB on that platform.
> > Have a look at mc_new_mem_stack_4 et al in mc_main.c.
>
> See also the stuff about "AbiHint" in VEX/pub/libvex_ir.h and
> memcheck/mc_translate.c, and the function helperc_MAKE_STACK_UNINIT in
> mc_main.c.
Thanks, this information allowed me to eliminate the false positives.
By the way, is the first argument passed to unsafeIRDirty_0_N() the
number of register parameters ? If so, why is the first argument of
unsafeIRDirty_0_N() in do_AbiHint (memcheck/mc_translate.c) zero
instead of two ?
>From memcheck/mc_translate.c:
static
void do_AbiHint ( MCEnv* mce, IRExpr* base, Int len )
{
IRDirty* di;
di = unsafeIRDirty_0_N(
0/*regparms*/,
"MC_(helperc_MAKE_STACK_UNINIT)",
VG_(fnptr_to_fnentry)( &MC_(helperc_MAKE_STACK_UNINIT) ),
mkIRExprVec_2( base, mkIRExpr_HWord( (UInt)len) )
);
stmt( mce->bb, IRStmt_Dirty(di) );
}
Regards,
Bart.
|