Browse files

fix valgrind errors

  • Loading branch information...
1 parent b329817 commit b3ff9d20ed373a0a68b9c5c649784ae7a1e84f85 @WalterBright WalterBright committed Feb 20, 2011
Showing with 7 additions and 6 deletions.
  1. +1 −1 src/backend/cgen.c
  2. +2 −2 src/backend/cod1.c
  3. +1 −1 src/backend/cod2.c
  4. +3 −2 src/backend/cod3.c
View
2 src/backend/cgen.c
@@ -173,8 +173,8 @@ code *gen(code *c,code *cs)
//printf("ce = %p %02x\n", ce, ce->Iop);
ccheck(ce);
if (config.flags4 & CFG4optimized &&
- ce->IFL2 == FLconst &&
(ce->Iop == 0x81 || ce->Iop == 0x80) &&
+ ce->IFL2 == FLconst &&
reghasvalue((ce->Iop == 0x80) ? BYTEREGS : ALLREGS,I64 ? ce->IEV2.Vsize_t : ce->IEV2.Vlong,&reg) &&
!(ce->Iflags & CFopsize && I16)
)
View
4 src/backend/cod1.c
@@ -1046,9 +1046,9 @@ code *getlvalue(code *pcs,elem *e,regm_t keepmsk)
pcs->Irm = modregrm(t,0,4);
pcs->Isib = modregrm(ssindex_array[ssi].ss2,r & 7,rbase & 7);
if (r & 8)
- code_orrex(pcs, REX_X);
+ pcs->Irex |= REX_X;
if (rbase & 8)
- code_orrex(pcs, REX_B);
+ pcs->Irex |= REX_B;
}
freenode(e11->E2);
freenode(e11);
View
2 src/backend/cod2.c
@@ -429,7 +429,7 @@ code *cdorth(elem *e,regm_t *pretregs)
if (reg2 & 8)
cs.Irex |= REX_B;
cs.IFL1 = FLconst;
- cs.IEV1.Vuns = edisp->EV.Vuns;
+ cs.IEV1.Vsize_t = edisp->EV.Vuns;
freenode(edisp);
freenode(e1);
View
5 src/backend/cod3.c
@@ -3678,14 +3678,15 @@ STATIC void pinholeopt_unittest()
void jmpaddr(code *c)
{ code *ci,*cn,*ctarg,*cstart;
targ_size_t ad;
- unsigned char op;
+ unsigned op;
//printf("jmpaddr()\n");
cstart = c; /* remember start of code */
while (c)
{
op = c->Iop;
- if (inssize[op & 0xFF] & T && // if second operand
+ if (op <= 0xEB &&
+ inssize[op] & T && // if second operand
c->IFL2 == FLcode &&
((op & ~0x0F) == 0x70 || op == JMP || op == JMPS || op == JCXZ))
{ ci = code_next(c);

0 comments on commit b3ff9d2

Please sign in to comment.