diff options
author | Ben Gamari <bgamari.foss@gmail.com> | 2017-10-29 20:46:45 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2017-10-29 20:47:05 -0400 |
commit | cecd2f2d708d419878205ddd8b87bba18e6483d9 (patch) | |
tree | 72837286086fb64d3b458d14cb95c13425cca8ea /rts/RtsMessages.c | |
parent | 3b784d440d4b01b4c549df7c9a3ed2058edfc780 (diff) | |
download | haskell-cecd2f2d708d419878205ddd8b87bba18e6483d9.tar.gz |
Add -falignment-sanitization flag
Here we add a flag to instruct the native code generator to add
alignment checks in all info table dereferences. This is helpful in
catching pointer tagging issues.
Thanks to @jrtc27 for uncovering the tagging issues on Sparc which
inspired this flag.
Test Plan: Validate
Reviewers: simonmar, austin, erikd
Reviewed By: simonmar
Subscribers: rwbarton, trofi, thomie, jrtc27
Differential Revision: https://phabricator.haskell.org/D4101
Diffstat (limited to 'rts/RtsMessages.c')
-rw-r--r-- | rts/RtsMessages.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/rts/RtsMessages.c b/rts/RtsMessages.c index ba1f02de29..d976760242 100644 --- a/rts/RtsMessages.c +++ b/rts/RtsMessages.c @@ -314,3 +314,13 @@ rtsDebugMsgFn(const char *s, va_list ap) _setmode (_fileno(stderr), mode); #endif } + + +// Used in stg_badAlignment_entry defined in StgStartup.cmm. +void rtsBadAlignmentBarf(void) GNUC3_ATTRIBUTE(__noreturn__); + +void +rtsBadAlignmentBarf() +{ + barf("Encountered incorrectly aligned pointer. This can't be good."); +} |