Shanks0224 opened a new pull request, #22269: URL: https://github.com/apache/nuttx/pull/22269
*Note: Please adhere to [Contributing Guidelines](https://github.com/apache/nuttx/blob/master/CONTRIBUTING.md).* ## Summary `nxsem_destroy()` read the flags of the semaphore to set up its locals before `DEBUGASSERT(sem != NULL)`, so a NULL semaphore faulted before the assertion could report it. Set the locals up after the check. ## Impact No functional change for a valid semaphore. With `CONFIG_DEBUG_ASSERTIONS`, a NULL semaphore is now reported by the assertion instead of faulting. No impact on the build system, documentation or hardware. ## Testing Build host: Linux x86_64. `sim:nsh` + `CONFIG_TESTING_OSTEST` + `CONFIG_CANCELLATION_POINTS`, full ostest: ``` ostest_main: Exiting with status 0 ``` `sim:nsh` builds with no warning. No regression test: the change only moves the use of the pointer after its assertion, and a NULL semaphore stops the system with or without it. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
