diff options
Diffstat (limited to 'compiler-rt/test/tsan/Darwin/gcd-io-race.mm')
-rw-r--r-- | compiler-rt/test/tsan/Darwin/gcd-io-race.mm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler-rt/test/tsan/Darwin/gcd-io-race.mm b/compiler-rt/test/tsan/Darwin/gcd-io-race.mm index 99000fca158..39dd806eeb6 100644 --- a/compiler-rt/test/tsan/Darwin/gcd-io-race.mm +++ b/compiler-rt/test/tsan/Darwin/gcd-io-race.mm @@ -23,8 +23,8 @@ int main(int argc, const char *argv[]) { sem = dispatch_semaphore_create(0); NSString *ns_path = [NSTemporaryDirectory() stringByAppendingPathComponent:[NSString stringWithFormat:@"temp-gcd-io.%d", getpid()]]; path = ns_path.fileSystemRepresentation; - NSData *ns_data = [NSMutableData dataWithLength:1000]; - data = dispatch_data_create(ns_data.bytes, ns_data.length, NULL, DISPATCH_DATA_DESTRUCTOR_DEFAULT); + char buf[1000]; + data = dispatch_data_create(buf, sizeof(buf), NULL, DISPATCH_DATA_DESTRUCTOR_DEFAULT); dispatch_io_t channel = dispatch_io_create_with_path(DISPATCH_IO_STREAM, path, O_CREAT | O_WRONLY, 0666, queue, ^(int error) { }); if (! channel) abort(); |