[ET Trac] #2655: Incorrect assert in Carpet/src/modes.cc

Samuel Cupp trac-noreply at einsteintoolkit.org
Fri Oct 7 15:44:06 CDT 2022


#2655: Incorrect assert in Carpet/src/modes.cc

 Reporter: Samuel Cupp
   Status: new
Milestone: 
  Version: development version
     Type: bug
 Priority: major
Component: Carpet

In Carpet/src/modes.cc, there is a block of asserts

```
      assert(cctkGH->cctk_lsh[d] >= 0);
      assert(cctkGH->cctk_lsh[d] <= cctkGH->cctk_gsh[d]);
      assert(cctkGH->cctk_lbnd[d] >= 0);
      assert(cctkGH->cctk_lbnd[d] <= cctkGH->cctk_ubnd[d] + 1);
      assert(cctkGH->cctk_ubnd[d] < cctkGH->cctk_gsh[d]);
      assert(cctkGH->cctk_lbnd[d] + cctkGH->cctk_lsh[d] - 1 ==
             cctkGH->cctk_ubnd[d]);
      assert(cctkGH->cctk_lbnd[d] <= cctkGH->cctk_ubnd[d] + 1);
      assert(cctkGH->cctk_lsh[d] <= cctkGH->cctk_ash[d]);
#ifdef CCTK_HAVE_CGH_TILE
      assert(cctkGH->cctk_tile_min[d] == 0);
      assert(cctkGH->cctk_tile_max[d] = cctkGH->cctk_lsh[d]);
#endif
      assert(cctkGH->cctk_from[d] >= 0);
      assert(cctkGH->cctk_from[d] <= cctkGH->cctk_to[d]);
      assert(cctkGH->cctk_to[d] <= cctkGH->cctk_lsh[d]);
```

Inside the #ifdef, the second assert

```
assert(cctkGH->cctk_tile_max[d] = cctkGH->cctk_lsh[d]);
```

is setting the value instead of doing a comparison. This is definitely wrong and should be changed.

--
Ticket URL: https://bitbucket.org/einsteintoolkit/tickets/issues/2655/incorrect-assert-in-carpet-src-modescc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.einsteintoolkit.org/pipermail/trac/attachments/20221007/935569bd/attachment.html 


More information about the Trac mailing list