Reviewed By: mbouaziz, jvillard Differential Revision: D10508880 fbshipit-source-id: 04e994468master
parent
33872ff0e9
commit
105b772cff
@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright (c) 2018-present, Facebook, Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
#import <Foundation/NSObject.h>
|
||||
#import <mutex>
|
||||
|
||||
@interface Basic : NSObject
|
||||
- (int)read;
|
||||
- (void)write:(int)data;
|
||||
@end
|
||||
|
||||
@implementation Basic {
|
||||
std::mutex mutex_;
|
||||
int data_;
|
||||
}
|
||||
|
||||
- (int)read {
|
||||
return data_;
|
||||
}
|
||||
|
||||
- (void)write:(int)data {
|
||||
mutex_.lock();
|
||||
data_ = data;
|
||||
mutex_.unlock();
|
||||
}
|
||||
@end
|
@ -0,0 +1,19 @@
|
||||
# Copyright (c) 2016-present, Facebook, Inc.
|
||||
#
|
||||
# This source code is licensed under the MIT license found in the
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
TESTS_DIR = ../../..
|
||||
|
||||
CLANG_OPTIONS = -c $(OBJCPP_CLANG_OPTIONS)
|
||||
|
||||
INFER_OPTIONS = --racerd-only --debug-exceptions --project-root $(TESTS_DIR)
|
||||
|
||||
INFERPRINT_OPTIONS = --issues-tests
|
||||
|
||||
SOURCES = $(wildcard *.mm)
|
||||
|
||||
include $(TESTS_DIR)/clang.make
|
||||
include $(TESTS_DIR)/objc.make
|
||||
|
||||
infer-out/report.json: $(MAKEFILE_LIST)
|
@ -0,0 +1 @@
|
||||
codetoanalyze/objcpp/racerd/Basic.mm, Basic_read, 21, LOCK_CONSISTENCY_VIOLATION, no_bucket, ERROR, [<Read trace>,access to `self.data_`,<Write trace>,access to `self.data_`]
|
Loading…
Reference in new issue