You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by GitBox <gi...@apache.org> on 2021/02/02 22:05:32 UTC

[GitHub] [qpid-dispatch] kgiusti opened a new pull request #1015: Dispatch 1948

kgiusti opened a new pull request #1015:
URL: https://github.com/apache/qpid-dispatch/pull/1015


   


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org


[GitHub] [qpid-dispatch] asfgit closed pull request #1015: Dispatch 1948

Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #1015:
URL: https://github.com/apache/qpid-dispatch/pull/1015


   


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org


[GitHub] [qpid-dispatch] jiridanek commented on a change in pull request #1015: Dispatch 1948

Posted by GitBox <gi...@apache.org>.
jiridanek commented on a change in pull request #1015:
URL: https://github.com/apache/qpid-dispatch/pull/1015#discussion_r569186459



##########
File path: src/alloc_pool.c
##########
@@ -435,7 +437,8 @@ void qd_dealloc(qd_alloc_type_desc_t *desc, qd_alloc_pool_t **tpool, char *p)
     assert (desc->header  == PATTERN_FRONT);
     assert (desc->trailer == PATTERN_BACK);
     assert (item->header  == PATTERN_FRONT);
-    assert (*((uint32_t*) (p + desc->total_size)) == PATTERN_BACK);
+    const uint32_t pb = PATTERN_BACK;
+    assert (memcmp(p + desc->total_size, &pb, sizeof(pb)) == 0);

Review comment:
       Uh, memcmp, never mind.




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org


[GitHub] [qpid-dispatch] jiridanek commented on a change in pull request #1015: Dispatch 1948

Posted by GitBox <gi...@apache.org>.
jiridanek commented on a change in pull request #1015:
URL: https://github.com/apache/qpid-dispatch/pull/1015#discussion_r569183788



##########
File path: src/alloc_pool.c
##########
@@ -435,7 +437,8 @@ void qd_dealloc(qd_alloc_type_desc_t *desc, qd_alloc_pool_t **tpool, char *p)
     assert (desc->header  == PATTERN_FRONT);
     assert (desc->trailer == PATTERN_BACK);
     assert (item->header  == PATTERN_FRONT);
-    assert (*((uint32_t*) (p + desc->total_size)) == PATTERN_BACK);
+    const uint32_t pb = PATTERN_BACK;

Review comment:
       ```
   /home/travis/build/apache/qpid-dispatch/src/alloc_pool.c:440:20: error: unused variable 'pb' [-Werror,-Wunused-variable]
   
       const uint32_t pb = PATTERN_BACK;
   ```

##########
File path: src/alloc_pool.c
##########
@@ -435,7 +437,8 @@ void qd_dealloc(qd_alloc_type_desc_t *desc, qd_alloc_pool_t **tpool, char *p)
     assert (desc->header  == PATTERN_FRONT);
     assert (desc->trailer == PATTERN_BACK);
     assert (item->header  == PATTERN_FRONT);
-    assert (*((uint32_t*) (p + desc->total_size)) == PATTERN_BACK);
+    const uint32_t pb = PATTERN_BACK;
+    assert (memcmp(p + desc->total_size, &pb, sizeof(pb)) == 0);

Review comment:
       I imagine Coverity will scream about this. Memcpy has side-efects and it is being used in an assert.

##########
File path: src/alloc_pool.c
##########
@@ -435,7 +437,8 @@ void qd_dealloc(qd_alloc_type_desc_t *desc, qd_alloc_pool_t **tpool, char *p)
     assert (desc->header  == PATTERN_FRONT);
     assert (desc->trailer == PATTERN_BACK);
     assert (item->header  == PATTERN_FRONT);
-    assert (*((uint32_t*) (p + desc->total_size)) == PATTERN_BACK);
+    const uint32_t pb = PATTERN_BACK;

Review comment:
       (That's because the next line is an assert, so it may not be always compiled in...)




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org