Fix bug in debug mode with presync_mode = "off"

Issue #2781 closed
Samuel Cupp created an issue

Currently, CCTK_HasAccess only checks access if presync_mode is set to presync_only. However, with debug on (CCTK_DEBUG is defined), it instead always checks access.

The first part of this code section asserts that the function has the attribute RDWR:

  assert(current_function->RDWR);

This is incompatible with the form of CCTKi_CreateRDWRData, which immediately returns if this parameter is set to off, meaning that this attribute is never created. As such, presync_mode="off" cannot run in debug mode, which is especially unacceptable for the default parameter setting. If presync is completely off, then it should never enter this section of the code.

Comments (10)

  1. Samuel Cupp reporter

    As requested, proposed fix simply removes the assert, as the function->RDWR element is not actually used anywhere in the function. As the function always returns true unless presync_mode="presync-only, there’s no problems with this.

  2. Log in to comment