Print this page
5083 avoid undefined order of operations in assignments

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/io/hxge/hxge_virtual.c
          +++ new/usr/src/uts/common/io/hxge/hxge_virtual.c
↓ open down ↓ 927 lines elided ↑ open up ↑
 928  928                  HXGE_DEBUG_MSG((NULL, INT_CTL,
 929  929                      "==> hxge_ldgv_setup: ldvp $%p ngrps %d",
 930  930                      *ldvp, *ngrps));
 931  931                  ++*ldvp;
 932  932          } else {
 933  933                  (*ldgp)->ldvp = *ldvp;
 934  934                  *ngrps += 1;
 935  935                  HXGE_DEBUG_MSG((NULL, INT_CTL, "==> hxge_ldgv_setup(done): "
 936  936                      "ldv %d endldg %d ldg %d, ldvp $%p",
 937  937                      ldv, endldg, (*ldgp)->ldg, (*ldgp)->ldvp));
 938      -                (*ldvp) = ++*ldvp;
 939      -                (*ldgp) = ++*ldgp;
      938 +                ++*ldvp;
      939 +                ++*ldgp;
 940  940                  HXGE_DEBUG_MSG((NULL, INT_CTL,
 941  941                      "==> hxge_ldgv_setup: new ngrps %d", *ngrps));
 942  942          }
 943  943  
 944  944          HXGE_DEBUG_MSG((NULL, INT_CTL, "==> hxge_ldgv_setup: "
 945  945              "ldg %d nldvs %d ldv %d ldvp $%p endldg %d ngrps %d",
 946  946              (*ldgp)->ldg, (*ldgp)->nldvs, ldv, ldvp, endldg, *ngrps));
 947  947  
 948  948          HXGE_DEBUG_MSG((NULL, INT_CTL, "<== hxge_ldgv_setup"));
 949  949  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX