Summary: Fix the logic for computing duplicate symbols. It was broken at some point and some duplicate symbols creeped into our tests. Fix these, and add a test to avoid duplicate symbols detection to regress again. Also, this removes one use of `Cfg.load`, on the way to removing file-wide CFGs from the database. Reviewed By: ngorogiannis Differential Revision: D10173349 fbshipit-source-id: a0d2365b3master
parent
7e20c8d380
commit
7615963bf4
@ -0,0 +1,13 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2015-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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
void test() {
|
||||||
|
int* s = NULL;
|
||||||
|
*s = 42;
|
||||||
|
}
|
@ -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
|
||||||
|
INFER_OPTIONS = --project-root ../codetoanalyze
|
||||||
|
INFERPRINT_OPTIONS = --issues-tests
|
||||||
|
|
||||||
|
SOURCES = ../codetoanalyze/hello.c ../codetoanalyze/hello_dup.c
|
||||||
|
|
||||||
|
include $(TESTS_DIR)/clang.make
|
||||||
|
|
||||||
|
issues.exp.test:
|
||||||
|
$(QUIET)cat infer-out$(TEST_SUFFIX)/duplicates.txt > $@
|
||||||
|
# delete duplicates file to avoid throwing an error because duplicate symbols were found
|
||||||
|
$(QUIET)$(REMOVE) infer-out$(TEST_SUFFIX)/duplicates.txt
|
@ -0,0 +1 @@
|
|||||||
|
DUPLICATE_SYMBOLS source:hello.c source_captured:hello_dup.c pname:test
|
Loading…
Reference in new issue