RTEMS | bsps/powerpc: The sbrk policy default and the exception frames (!1414)
Vijay Banerjee (@vijay)
gitlab at rtems.org
Thu Aug 20 23:05:23 UTC 2026
Vijay Banerjee commented on a discussion on bsps/powerpc/shared/start/sbrk.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1414#note_157533
> remaining_size = rval;
> }
>
> - policy = (0 == BSP_sbrk_policy[0] ? (uintptr_t)(-1) : BSP_sbrk_policy[0]);
> + /*
> + * BSP_sbrk_policy is an optional application provided symbol. Test the
> + * symbol address before the dereference, otherwise an application which
> + * does not provide the symbol reads whatever resides at address zero.
> + */
> + if (BSP_sbrk_policy == NULL || 0 == BSP_sbrk_policy[0]) {
I understand the rationale and don't have a strong opinion on either side. However, maintaining the value on the right side is more consistent with the rest of the code. The same line of code has two different comparison directions.
--
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1414#note_157533
You're receiving this email because of your account on gitlab.rtems.org. Unsubscribe from this thread: https://gitlab.rtems.org/-/sent_notifications/5-ab8p9tskfjeag0c0e4hvoe9ye-1d/unsubscribe | Manage all notifications: https://gitlab.rtems.org/-/profile/notifications | Help: https://gitlab.rtems.org/help
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20260820/241362fa/attachment.htm>
More information about the bugs
mailing list