Fill in a few more DWARF3 'expression' related cases.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6626
This commit is contained in:
Julian Seward
2007-02-28 01:46:30 +00:00
parent 7efbc7213b
commit 142e2aedb7
2 changed files with 64 additions and 33 deletions

View File

@@ -998,6 +998,7 @@ UWord evalCfiExpr ( XArray* exprs, Int ix,
CfiExprEvalContext* eec, Bool* ok )
{
UWord wL, wR;
Addr a;
CfiExpr* e = VG_(indexXA)( exprs, ix );
switch (e->tag) {
case Cex_Binop:
@@ -1008,6 +1009,7 @@ UWord evalCfiExpr ( XArray* exprs, Int ix,
switch (e->Cex.Binop.op) {
case Cop_Add: return wL + wR;
case Cop_Sub: return wL - wR;
case Cop_And: return wL & wR;
default: goto unhandled;
}
/*NOTREACHED*/
@@ -1021,6 +1023,16 @@ UWord evalCfiExpr ( XArray* exprs, Int ix,
/*NOTREACHED*/
case Cex_Const:
return e->Cex.Const.con;
case Cex_Deref:
a = evalCfiExpr( exprs, e->Cex.Deref.ixAddr, eec, ok );
if (!(*ok)) return 0;
if (a < eec->min_accessible
|| (a + sizeof(UWord) - 1) > eec->max_accessible) {
*ok = False;
return 0;
}
/* let's hope it doesn't trap! */
return * ((UWord*)a);
default:
goto unhandled;
}