forked from llvm-mirror/clang
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[objcmt] Fix a buffer overflow crash than can occur while modernizing…
… enums. Note that due to the nature of the crash it requires libgmalloc or asan for it to crash consistently. rdar://19932927 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@275600 91177308-0d34-0410-b5e6-96231b3b80d8
- Loading branch information
Showing
4 changed files
with
46 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// RUN: rm -rf %t | ||
// RUN: %clang_cc1 -objcmt-migrate-ns-macros -mt-migrate-directory %t %s -x objective-c -fobjc-runtime-has-weak -fobjc-arc -triple x86_64-apple-darwin11 | ||
// RUN: c-arcmt-test -mt-migrate-directory %t | arcmt-test -verify-transformed-files %s.result | ||
|
||
#define NS_ENUM(_type, _name) enum _name : _type _name; enum _name : _type | ||
#define NS_OPTIONS(_type, _name) enum _name : _type _name; enum _name : _type | ||
typedef long NSInteger; | ||
|
||
typedef enum : NSInteger {five} ApplicableEnum; | ||
|
||
typedef unsigned long mytd; | ||
|
||
#define MY_ENUM(name, type, ...) typedef enum : type { __VA_ARGS__ } name##_t | ||
MY_ENUM(MyEnum, unsigned int, One); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// RUN: rm -rf %t | ||
// RUN: %clang_cc1 -objcmt-migrate-ns-macros -mt-migrate-directory %t %s -x objective-c -fobjc-runtime-has-weak -fobjc-arc -triple x86_64-apple-darwin11 | ||
// RUN: c-arcmt-test -mt-migrate-directory %t | arcmt-test -verify-transformed-files %s.result | ||
|
||
#define NS_ENUM(_type, _name) enum _name : _type _name; enum _name : _type | ||
#define NS_OPTIONS(_type, _name) enum _name : _type _name; enum _name : _type | ||
typedef long NSInteger; | ||
|
||
typedef NS_ENUM(NSInteger, ApplicableEnum) {five}; | ||
|
||
typedef unsigned long mytd; | ||
|
||
#define MY_ENUM(name, type, ...) typedef enum : type { __VA_ARGS__ } name##_t | ||
MY_ENUM(MyEnum, unsigned int, One); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters