patacongo commented on a change in pull request #1562: URL: https://github.com/apache/incubator-nuttx/pull/1562#discussion_r469976309
########## File path: arch/arm/src/common/arm_createstack.c ########## @@ -102,26 +102,26 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype) { - /* Add the size of the TLS information structure */ + size_t alloc_size; - stack_size += sizeof(struct tls_info_s); + /* Add the size of the TLS information structure and align */ + + alloc_size = STACK_ALIGN_UP(stack_size + sizeof(struct tls_info_s)); #ifdef CONFIG_TLS_ALIGNED /* The allocated stack size must not exceed the maximum possible for the * TLS feature. */ - DEBUGASSERT(stack_size <= TLS_MAXSTACK); - if (stack_size >= TLS_MAXSTACK) + DEBUGASSERT(alloc_size <= TLS_MAXSTACK); Review comment: Isn't this assertion backward? ```suggestion DEBUGASSERT(alloc_size > TLS_MAXSTACK); ``` We will take the assertion if the condition is false. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org