1. petsc
  2. PETSc
  3. petsc

Commits

Jed Brown  committed 7fcd4ef

DMPlex: initialize entire hash key instead of hashing uninitialized memory

  • Participants
  • Parent commits eea2bde
  • Branches master

Comments (0)

Files changed (1)

File src/dm/impls/plex/plexinterpolate.c

View file
  • Ignore whitespace
       if (faceSize == 2) {
         key.i = PetscMin(cellFace[0], cellFace[1]);
         key.j = PetscMax(cellFace[0], cellFace[1]);
+        key.k = 0;
+        key.l = 0;
       } else {
         key.i = cellFace[0]; key.j = cellFace[1]; key.k = cellFace[2]; key.l = faceSize > 3 ? cellFace[3] : 0;
         ierr = PetscSortInt(faceSize, (PetscInt *) &key);
       if (faceSize == 2) {
         key.i = PetscMin(cellFace[0], cellFace[1]);
         key.j = PetscMax(cellFace[0], cellFace[1]);
+        key.k = 0;
+        key.l = 0;
       } else {
         key.i = cellFace[0]; key.j = cellFace[1]; key.k = cellFace[2]; key.l = faceSize > 3 ? cellFace[3] : 0;
         ierr = PetscSortInt(faceSize, (PetscInt *) &key);