Reviewed By: ngorogiannis Differential Revision: D17183375 fbshipit-source-id: 0ecdf2072master
parent
27ea5d041b
commit
5c58689493
@ -0,0 +1,17 @@
|
||||
# Copyright (c) Facebook, Inc. and its affiliates.
|
||||
#
|
||||
# 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 $(OBJC_CLANG_OPTIONS)
|
||||
INFER_OPTIONS = --pulse-only --debug-exceptions --project-root $(TESTS_DIR)
|
||||
INFERPRINT_OPTIONS = --issues-tests
|
||||
|
||||
SOURCES = $(wildcard *.m)
|
||||
|
||||
include $(TESTS_DIR)/clang.make
|
||||
include $(TESTS_DIR)/objc.make
|
||||
|
||||
infer-out/report.json: $(MAKEFILE_LIST)
|
@ -0,0 +1,2 @@
|
||||
codetoanalyze/objc/pulse/use_after_free.m, PulseTest::use_after_free_simple_in_objc_method_bad:, 2, USE_AFTER_FREE, no_bucket, ERROR, [invalidation part of the trace starts here,memory was invalidated by call to `free()` here,use-after-lifetime part of the trace starts here,invalid access occurs here]
|
||||
codetoanalyze/objc/pulse/use_after_free.m, use_after_free_simple_bad, 2, USE_AFTER_FREE, no_bucket, ERROR, [invalidation part of the trace starts here,memory was invalidated by call to `free()` here,use-after-lifetime part of the trace starts here,invalid access occurs here]
|
@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* 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>
|
||||
|
||||
@interface PulseTest : NSObject
|
||||
|
||||
- (int)use_after_free_simple_in_objc_method_bad:(int*)x;
|
||||
|
||||
@end
|
||||
|
||||
@implementation PulseTest
|
||||
|
||||
- (int)use_after_free_simple_in_objc_method_bad:(int*)x {
|
||||
free(x);
|
||||
return *x;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
int use_after_free_simple_bad(int* x) {
|
||||
free(x);
|
||||
return *x;
|
||||
}
|
Loading…
Reference in new issue