This is an archive of the discontinued LLVM Phabricator instance.

[Clang] Cover '#pragma clang __debug overflow_stack' in tests
Changes PlannedPublic

Authored by aganea on Feb 7 2020, 9:16 AM.

Details

Reviewers
rnk
hans
Summary

Previously, #pragma clang __debug overflow_stack wasn't really working, the function was simply looping and not overflowing.
I tested this in various configurations, with Clang 9, MSVC 2017/2019 and GCC 9 on Ubuntu.

Diff Detail

Event Timeline

aganea created this revision.Feb 7 2020, 9:16 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 7 2020, 9:16 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
aganea marked an inline comment as done.Feb 7 2020, 9:19 AM
aganea added inline comments.
clang/lib/Lex/Pragma.cpp
1148

Would it be better if we had something like LLVM_[DISABLE|ENABLE]_OPT in Compiler.h instead of the #ifdefs? That would map to #pragma clang optimize [off|on] (and corresponding #pragma on MSVC/GCC). Note that there's no way I know of to disable optimizations on a per-function basis on MSVC.

aganea planned changes to this revision.Feb 7 2020, 10:01 AM

Withdrawing this, I found an crash in Debug build. I think this can't work without doing all the crash processing in a separate, pre-allocated thread.