This patch does not apply cleanly. It looks like parts of it might have already been applied, and those parts look unrelated to the advertised feature of this ticket.
MacBook-2:flesh (trunk) $ patch -p0 < /Downloads/gfindex.diff
patching file src/include/cctk.h
Hunk #1 FAILED at 175.
Hunk #3 FAILED at 349.
Hunk #6 FAILED at 424.
3 out of 6 hunks FAILED -- saving rejects to file src/include/cctk.h.rej
patching file src/main/DebugDefines.c
Reversed (or previously applied) patch detected! Assume -R? [n] ^C
Do you have any comments on the content of the patch?
I attach a new version of this patch.
The patch looks to be correct, and should be very useful if people know about using the DEBUG option. Most people probably think, as I did, that it enables debugging symbols. In fact, the simfactory documentation on the "--debug" option states this.
I have tested (on my laptop) that the ML_BSSN_sgw3d_rhs test still passes both with and without DEBUG=yes (via simfactory --debug), and that if I manually edit the code in McLachlan to loop outside the range with --debug, I get the required error.
The patch uses cctk_lsh. Should it use cctk_lssh instead, to be compatible with future padding features? I don't remember the details of that.
I took the index checking code from the file DebugDefines.c, which is used if CCTK_DEBUG is set and if inlining is not supported.