Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

fix valgrind errors

  • Loading branch information...
commit b3ff9d20ed373a0a68b9c5c649784ae7a1e84f85 1 parent b329817
Walter Bright WalterBright authored
2  src/backend/cgen.c
@@ -173,8 +173,8 @@ code *gen(code *c,code *cs)
173 173 //printf("ce = %p %02x\n", ce, ce->Iop);
174 174 ccheck(ce);
175 175 if (config.flags4 & CFG4optimized &&
176   - ce->IFL2 == FLconst &&
177 176 (ce->Iop == 0x81 || ce->Iop == 0x80) &&
  177 + ce->IFL2 == FLconst &&
178 178 reghasvalue((ce->Iop == 0x80) ? BYTEREGS : ALLREGS,I64 ? ce->IEV2.Vsize_t : ce->IEV2.Vlong,&reg) &&
179 179 !(ce->Iflags & CFopsize && I16)
180 180 )
4 src/backend/cod1.c
@@ -1046,9 +1046,9 @@ code *getlvalue(code *pcs,elem *e,regm_t keepmsk)
1046 1046 pcs->Irm = modregrm(t,0,4);
1047 1047 pcs->Isib = modregrm(ssindex_array[ssi].ss2,r & 7,rbase & 7);
1048 1048 if (r & 8)
1049   - code_orrex(pcs, REX_X);
  1049 + pcs->Irex |= REX_X;
1050 1050 if (rbase & 8)
1051   - code_orrex(pcs, REX_B);
  1051 + pcs->Irex |= REX_B;
1052 1052 }
1053 1053 freenode(e11->E2);
1054 1054 freenode(e11);
2  src/backend/cod2.c
@@ -429,7 +429,7 @@ code *cdorth(elem *e,regm_t *pretregs)
429 429 if (reg2 & 8)
430 430 cs.Irex |= REX_B;
431 431 cs.IFL1 = FLconst;
432   - cs.IEV1.Vuns = edisp->EV.Vuns;
  432 + cs.IEV1.Vsize_t = edisp->EV.Vuns;
433 433
434 434 freenode(edisp);
435 435 freenode(e1);
5 src/backend/cod3.c
@@ -3678,14 +3678,15 @@ STATIC void pinholeopt_unittest()
3678 3678 void jmpaddr(code *c)
3679 3679 { code *ci,*cn,*ctarg,*cstart;
3680 3680 targ_size_t ad;
3681   - unsigned char op;
  3681 + unsigned op;
3682 3682
3683 3683 //printf("jmpaddr()\n");
3684 3684 cstart = c; /* remember start of code */
3685 3685 while (c)
3686 3686 {
3687 3687 op = c->Iop;
3688   - if (inssize[op & 0xFF] & T && // if second operand
  3688 + if (op <= 0xEB &&
  3689 + inssize[op] & T && // if second operand
3689 3690 c->IFL2 == FLcode &&
3690 3691 ((op & ~0x0F) == 0x70 || op == JMP || op == JMPS || op == JCXZ))
3691 3692 { ci = code_next(c);

0 comments on commit b3ff9d2

Please sign in to comment.
Something went wrong with that request. Please try again.