Skip to content

Commit

Permalink
Fix linux.signest test failure on AArch64.
Browse files Browse the repository at this point in the history
char is unsigned by default on ARM based machines; https://www.arm.linux.org.uk/docs/faqs/signedchar.php. This leads to wrong usage of the signals_pending variable, which is negative when a signal is being handled.
  • Loading branch information
abhinav92003 committed Sep 29, 2020
1 parent 8a94318 commit 75b1231
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -912,7 +912,11 @@ struct _dcontext_t {

dr_where_am_i_t whereami; /* where control is at the moment */
#ifdef UNIX
char signals_pending; /* != 0: pending; < 0: currently handling one */
/* On ARM based machines, char is unsigned by default.
* https://www.arm.linux.org.uk/docs/faqs/signedchar.php
* But we need signed char, so we explicitly qualify this declaration.
*/
signed char signals_pending; /* != 0: pending; < 0: currently handling one */
#endif

/************* end of offset-crucial fields *********************/
Expand Down

0 comments on commit 75b1231

Please sign in to comment.