From f91cfd225fdd0a5d2d6bbabf3fadad11205a66e5 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 6 Aug 2015 17:08:38 +0300 Subject: Add test 43. --- test/Makefile | 15 +- test/test43-01.txt | 756 +++++++++++++++++++++++++++++++++++++++++++++++++++++ test/test43-02.txt | 11 + test/test43-03.txt | 255 ++++++++++++++++++ test/test43-04.txt | 4 + test/test43-05.txt | 4 + test/test43.cpp | 84 ++++++ 7 files changed, 1128 insertions(+), 1 deletion(-) create mode 100644 test/test43-01.txt create mode 100644 test/test43-02.txt create mode 100644 test/test43-03.txt create mode 100644 test/test43-04.txt create mode 100644 test/test43-05.txt create mode 100644 test/test43.cpp diff --git a/test/Makefile b/test/Makefile index b5ff3e8..b097a0a 100644 --- a/test/Makefile +++ b/test/Makefile @@ -46,7 +46,8 @@ TESTS39 = $(call TEST,39,5) TESTS40 = $(call TEST,40,5) TESTS41 = $(call TEST,41,5) TESTS42 = $(call TEST,42,5) -TESTNUMBERS = 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 +TESTS43 = $(call TEST,43,5) +TESTNUMBERS = 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 ALLTESTS = $(foreach num,$(TESTNUMBERS),test$(num) ${TESTS$(num)}) .PHONY: ${ALLTESTS} ${CRASHES} all crashes @@ -525,6 +526,18 @@ test42-04: test42-05: $(call CMDXX,detectnullpointers,test42.cpp,test42-05.txt,-O2 -std=c++0x -Wall -Wnonnull) +test43: ${TESTS43} +test43-01: + $(call CMDXX,dump,test43.cpp,test43-01.txt,-std=c++0x) +test43-02: + $(call CMDXX,findargs,test43.cpp,test43-02.txt,-std=c++0x) +test43-03: + $(call CMDXX,dumpnullpointers,test43.cpp,test43-03.txt,-std=c++0x) +test43-04: + $(call CMDXX,detectnullpointers,test43.cpp,test43-04.txt,-std=c++0x) +test43-05: + $(call CMDXX,detectnullpointers,test43.cpp,test43-05.txt,-O2 -std=c++0x -Wall -Wnonnull) + crashtest01: $(call CMDXX,dump,crashtest01.h,crashtest01-01.txt) crashtest02: diff --git a/test/test43-01.txt b/test/test43-01.txt new file mode 100644 index 0000000..dd8852d --- /dev/null +++ b/test/test43-01.txt @@ -0,0 +1,756 @@ +function_decl getData3 test43.cpp 9:12 2147483647 +- isPublic: 1 + method_type 2147483646 - function type + pointer_type 2147483645 - method return type + record_type 3 - nested type + type_decl Data1 test43.cpp 1:8 2 - type name + - isAutogenerated: 1 + record_type 2147483645 - method base type + type_decl Data2 test43.cpp 4:8 2147483644 - type name + - isAutogenerated: 1 + tree_list 2147483645 - arg types + pointer_type 2147483644 - value + record_type 3 - nested type + type_decl Data2 test43.cpp 4:8 2 - type name + - isAutogenerated: 1 + tree_list 2147483644 - chain + void_type 2147483643 - value + type_decl void 0:0 2147483642 - type name + - isAutogenerated: 1 + result_decl test43.cpp 10:5 2147483646 - function result + - isAutogenerated: 1 + pointer_type 2147483645 - result type + record_type 3 - nested type + type_decl Data1 test43.cpp 1:8 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483645 - decl size + - isUsed: 1 + parm_decl this test43.cpp 9:21 2147483646 - argument + - isAutogenerated: 1 + pointer_type 2147483645 - decl type + record_type 3 - nested type + type_decl Data2 test43.cpp 4:8 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483645 - parm size + return_expr test43.cpp 11:16 2147483646 - code + init_expr 2147483645 - operand + result_decl test43.cpp 10:5 2147483644 - operand + - isAutogenerated: 1 + pointer_type 2147483643 - result type + record_type 3 - nested type + type_decl Data1 test43.cpp 1:8 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483643 - decl size + component_ref test43.cpp 11:16 2147483644 - operand + indirect_ref 2147483643 - object + nop_expr 2147483642 - ref + - isUsed: 1 + parm_decl this test43.cpp 9:21 2147483641 - operand + - isAutogenerated: 1 + pointer_type 2147483640 - decl type + record_type 3 - nested type + type_decl Data2 test43.cpp 4:8 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483640 - parm size + field_decl ptrval test43.cpp 7:12 2147483643 - field + - unsigned + integer_cst 64 2147483642 - decl size + pointer_type 5 - field type + record_type 3 - nested type + type_decl Data1 test43.cpp 1:8 2 - type name + - isAutogenerated: 1 +function_decl getData2 test43.cpp 23:12 2147483647 +- isPublic: 1 + method_type 2147483646 - function type + pointer_type 2147483645 - method return type + record_type 3 - nested type + type_decl Data1 test43.cpp 15:8 2 - type name + - isAutogenerated: 1 + record_type 2147483645 - method base type + type_decl Data1 test43.cpp 15:8 2147483644 - type name + - isAutogenerated: 1 + tree_list 2147483645 - arg types + pointer_type 2147483644 - value + record_type 3 - nested type + type_decl Data1 test43.cpp 15:8 2 - type name + - isAutogenerated: 1 + tree_list 2147483644 - chain + void_type 2147483643 - value + type_decl void 0:0 2147483642 - type name + - isAutogenerated: 1 + result_decl test43.cpp 24:5 2147483646 - function result + - isAutogenerated: 1 + pointer_type 2147483645 - result type + record_type 3 - nested type + type_decl Data1 test43.cpp 15:8 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483645 - decl size + - isUsed: 1 + parm_decl this test43.cpp 23:21 2147483646 - argument + - isAutogenerated: 1 + pointer_type 2147483645 - decl type + record_type 3 - nested type + type_decl Data1 test43.cpp 15:8 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483645 - parm size + return_expr test43.cpp 25:16 2147483646 - code + init_expr 2147483645 - operand + result_decl test43.cpp 24:5 2147483644 - operand + - isAutogenerated: 1 + pointer_type 2147483643 - result type + record_type 3 - nested type + type_decl Data1 test43.cpp 15:8 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483643 - decl size + component_ref test43.cpp 25:16 2147483644 - operand + indirect_ref 2147483643 - object + nop_expr 2147483642 - ref + - isUsed: 1 + parm_decl this test43.cpp 23:21 2147483641 - operand + - isAutogenerated: 1 + pointer_type 2147483640 - decl type + record_type 3 - nested type + type_decl Data1 test43.cpp 15:8 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483640 - parm size + field_decl ptrval test43.cpp 18:12 2147483643 - field + - unsigned + integer_cst 64 2147483642 - decl size + pointer_type 5 - field type + record_type 3 - nested type + type_decl Data1 test43.cpp 15:8 2 - type name + - isAutogenerated: 1 +function_decl getData3 test43.cpp 28:20 2147483647 +- isVirtual: 1 +- isPublic: 1 + method_type 2147483646 - function type + pointer_type 2147483645 - method return type + record_type 3 - nested type + type_decl Data1 test43.cpp 15:8 2 - type name + - isAutogenerated: 1 + record_type 2147483645 - method base type + type_decl Data1 test43.cpp 15:8 2147483644 - type name + - isAutogenerated: 1 + tree_list 2147483645 - arg types + pointer_type 2147483644 - value + record_type 3 - nested type + type_decl Data1 test43.cpp 15:8 2 - type name + - isAutogenerated: 1 + tree_list 2147483644 - chain + reference_type 2147483643 - value + integer_type 2147483642 - nested type + - precisionBits: 32 + - signed + type_decl int 0:0 2147483641 - type name + - isAutogenerated: 1 + integer_cst 32 2147483641 - type size + integer_cst -2147483648 2147483641 - min value + integer_cst 2147483647 2147483641 - max value + tree_list 2147483643 - chain + void_type 2147483642 - value + type_decl void 0:0 2147483641 - type name + - isAutogenerated: 1 + result_decl test43.cpp 29:5 2147483646 - function result + - isAutogenerated: 1 + pointer_type 2147483645 - result type + record_type 3 - nested type + type_decl Data1 test43.cpp 15:8 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483645 - decl size + - isUsed: 1 + parm_decl this test43.cpp 28:35 2147483646 - argument + - isAutogenerated: 1 + pointer_type 2147483645 - decl type + record_type 3 - nested type + type_decl Data1 test43.cpp 15:8 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483645 - parm size + - isUsed: 1 + parm_decl k test43.cpp 28:34 2147483646 - argument + reference_type 2147483645 - decl type + integer_type 2147483644 - nested type + - precisionBits: 32 + - signed + type_decl int 0:0 2147483643 - type name + - isAutogenerated: 1 + integer_cst 32 2147483643 - type size + integer_cst -2147483648 2147483643 - min value + integer_cst 2147483647 2147483643 - max value + integer_cst 64 2147483645 - parm size + statement_list 2147483646 - code + cleanup_point_expr test43.cpp 30:16 2147483645 - statement + expr_stmt test43.cpp 30:16 2147483644 - operand + convert_expr 2147483643 - expresssion + modify_expr 2147483642 - operand + component_ref test43.cpp 30:9 2147483641 - operand + indirect_ref 2147483640 - object + nop_expr 2147483639 - ref + - isUsed: 1 + parm_decl this test43.cpp 28:35 2147483638 - operand + - isAutogenerated: 1 + pointer_type 2147483637 - decl type + record_type 3 - nested type + type_decl Data1 test43.cpp 15:8 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483637 - parm size + field_decl val test43.cpp 17:9 2147483640 - field + - signed + integer_cst 32 2147483639 - decl size + integer_type 5 - field type + - precisionBits: 32 + - signed + type_decl int 0:0 4 - type name + - isAutogenerated: 1 + integer_cst 32 4 - type size + integer_cst -2147483648 4 - min value + integer_cst 2147483647 4 - max value + indirect_ref 2147483641 - operand + - isUsed: 1 + parm_decl k test43.cpp 28:34 2147483640 - ref + reference_type 2147483639 - decl type + integer_type 2147483638 - nested type + - precisionBits: 32 + - signed + type_decl int 0:0 2147483637 - type name + - isAutogenerated: 1 + integer_cst 32 2147483637 - type size + integer_cst -2147483648 2147483637 - min value + integer_cst 2147483647 2147483637 - max value + integer_cst 64 2147483639 - parm size + return_expr test43.cpp 31:16 2147483645 - statement + init_expr 2147483644 - operand + result_decl test43.cpp 29:5 2147483643 - operand + - isAutogenerated: 1 + pointer_type 2147483642 - result type + record_type 3 - nested type + type_decl Data1 test43.cpp 15:8 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483642 - decl size + component_ref test43.cpp 31:16 2147483643 - operand + indirect_ref 2147483642 - object + nop_expr 2147483641 - ref + - isUsed: 1 + parm_decl this test43.cpp 28:35 2147483640 - operand + - isAutogenerated: 1 + pointer_type 2147483639 - decl type + record_type 3 - nested type + type_decl Data1 test43.cpp 15:8 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483639 - parm size + field_decl ptrval test43.cpp 18:12 2147483642 - field + - unsigned + integer_cst 64 2147483641 - decl size + pointer_type 5 - field type + record_type 3 - nested type + type_decl Data1 test43.cpp 15:8 2 - type name + - isAutogenerated: 1 +function_decl getData4 test43.cpp 33:19 2147483647 +- isPublic: 1 + function_type 2147483646 - function type + pointer_type 2147483645 - function return type + record_type 3 - nested type + type_decl Data1 test43.cpp 15:8 2 - type name + - isAutogenerated: 1 + tree_list 2147483645 - arg types + void_type 2147483644 - value + type_decl void 0:0 2147483643 - type name + - isAutogenerated: 1 + result_decl test43.cpp 34:5 2147483646 - function result + - isAutogenerated: 1 + pointer_type 2147483645 - result type + record_type 3 - nested type + type_decl Data1 test43.cpp 15:8 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483645 - decl size + return_expr test43.cpp 35:16 2147483646 - code + init_expr 2147483645 - operand + result_decl test43.cpp 34:5 2147483644 - operand + - isAutogenerated: 1 + pointer_type 2147483643 - result type + record_type 3 - nested type + type_decl Data1 test43.cpp 15:8 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483643 - decl size + integer_cst 0 2147483644 - operand +function_decl getData5 test43.cpp 37:12 2147483647 +- isPublic: 1 + method_type 2147483646 - function type + tree_list 2147483645 - attribute + identifier_node returns_nonnull 2147483644 - purpose + pointer_type 2147483645 - method return type + record_type 3 - nested type + type_decl Data2 test43.cpp 4:8 2 - type name + - isAutogenerated: 1 + record_type 2147483645 - method base type + type_decl Data1 test43.cpp 15:8 2147483644 - type name + - isAutogenerated: 1 + tree_list 2147483645 - arg types + pointer_type 2147483644 - value + record_type 3 - nested type + type_decl Data1 test43.cpp 15:8 2 - type name + - isAutogenerated: 1 + tree_list 2147483644 - chain + void_type 2147483643 - value + type_decl void 0:0 2147483642 - type name + - isAutogenerated: 1 + result_decl test43.cpp 38:5 2147483646 - function result + - isAutogenerated: 1 + pointer_type 2147483645 - result type + record_type 3 - nested type + type_decl Data2 test43.cpp 4:8 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483645 - decl size + - isUsed: 1 + parm_decl this test43.cpp 37:54 2147483646 - argument + - isAutogenerated: 1 + pointer_type 2147483645 - decl type + record_type 3 - nested type + type_decl Data1 test43.cpp 15:8 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483645 - parm size + return_expr test43.cpp 39:17 2147483646 - code + init_expr 2147483645 - operand + result_decl test43.cpp 38:5 2147483644 - operand + - isAutogenerated: 1 + pointer_type 2147483643 - result type + record_type 3 - nested type + type_decl Data2 test43.cpp 4:8 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483643 - decl size + addr_expr 2147483644 - operand + component_ref test43.cpp 39:17 2147483643 - operand + indirect_ref 2147483642 - object + nop_expr 2147483641 - ref + - isUsed: 1 + parm_decl this test43.cpp 37:54 2147483640 - operand + - isAutogenerated: 1 + pointer_type 2147483639 - decl type + record_type 3 - nested type + type_decl Data1 test43.cpp 15:8 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483639 - parm size + field_decl perm test43.cpp 19:11 2147483642 - field + - signed + integer_cst 256 2147483641 - decl size + record_type 5 - field type + type_decl Data2 test43.cpp 4:8 4 - type name + - isAutogenerated: 1 +function_decl getData6 test43.cpp 41:20 2147483647 +- isVirtual: 1 +- isPublic: 1 + method_type 2147483646 - function type + pointer_type 2147483645 - method return type + record_type 3 - nested type + type_decl Data1 test43.cpp 15:8 2 - type name + - isAutogenerated: 1 + record_type 2147483645 - method base type + type_decl Data1 test43.cpp 15:8 2147483644 - type name + - isAutogenerated: 1 + tree_list 2147483645 - arg types + pointer_type 2147483644 - value + record_type 3 - nested type + type_decl Data1 test43.cpp 15:8 2 - type name + - isAutogenerated: 1 + tree_list 2147483644 - chain + void_type 2147483643 - value + type_decl void 0:0 2147483642 - type name + - isAutogenerated: 1 + result_decl test43.cpp 42:5 2147483646 - function result + - isAutogenerated: 1 + pointer_type 2147483645 - result type + record_type 3 - nested type + type_decl Data1 test43.cpp 15:8 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483645 - decl size + parm_decl this test43.cpp 41:29 2147483646 - argument + - isAutogenerated: 1 + pointer_type 2147483645 - decl type + record_type 3 - nested type + type_decl Data1 test43.cpp 15:8 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483645 - parm size + return_expr test43.cpp 43:16 2147483646 - code + init_expr 2147483645 - operand + result_decl test43.cpp 42:5 2147483644 - operand + - isAutogenerated: 1 + pointer_type 2147483643 - result type + record_type 3 - nested type + type_decl Data1 test43.cpp 15:8 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483643 - decl size + integer_cst 0 2147483644 - operand +function_decl getData1 test43.cpp 60:12 2147483647 +- isPublic: 1 + method_type 2147483646 - function type + pointer_type 2147483645 - method return type + record_type 3 - nested type + type_decl Data1 test43.cpp 15:8 2 - type name + - isAutogenerated: 1 + record_type 2147483645 - method base type + type_decl Object1 test43.cpp 54:7 2147483644 - type name + - isAutogenerated: 1 + tree_list 2147483645 - arg types + pointer_type 2147483644 - value + record_type 3 - nested type + type_decl Object1 test43.cpp 54:7 2 - type name + - isAutogenerated: 1 + tree_list 2147483644 - chain + void_type 2147483643 - value + type_decl void 0:0 2147483642 - type name + - isAutogenerated: 1 + result_decl test43.cpp 61:5 2147483646 - function result + - isAutogenerated: 1 + pointer_type 2147483645 - result type + record_type 3 - nested type + type_decl Data1 test43.cpp 15:8 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483645 - decl size + - isUsed: 1 + parm_decl this test43.cpp 60:21 2147483646 - argument + - isAutogenerated: 1 + pointer_type 2147483645 - decl type + record_type 3 - nested type + type_decl Object1 test43.cpp 54:7 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483645 - parm size + return_expr test43.cpp 62:16 2147483646 - code + init_expr 2147483645 - operand + result_decl test43.cpp 61:5 2147483644 - operand + - isAutogenerated: 1 + pointer_type 2147483643 - result type + record_type 3 - nested type + type_decl Data1 test43.cpp 15:8 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483643 - decl size + component_ref test43.cpp 62:16 2147483644 - operand + indirect_ref 2147483643 - object + nop_expr 2147483642 - ref + - isUsed: 1 + parm_decl this test43.cpp 60:21 2147483641 - operand + - isAutogenerated: 1 + pointer_type 2147483640 - decl type + record_type 3 - nested type + type_decl Object1 test43.cpp 54:7 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483640 - parm size + field_decl tmp2 test43.cpp 57:12 2147483643 - field + - unsigned + integer_cst 64 2147483642 - decl size + pointer_type 5 - field type + record_type 3 - nested type + type_decl Data1 test43.cpp 15:8 2 - type name + - isAutogenerated: 1 +function_decl getData2 test43.cpp 65:12 2147483647 +- isPublic: 1 + method_type 2147483646 - function type + pointer_type 2147483645 - method return type + record_type 3 - nested type + type_decl Data1 test43.cpp 15:8 2 - type name + - isAutogenerated: 1 + record_type 2147483645 - method base type + type_decl Object1 test43.cpp 54:7 2147483644 - type name + - isAutogenerated: 1 + tree_list 2147483645 - arg types + pointer_type 2147483644 - value + record_type 3 - nested type + type_decl Object1 test43.cpp 54:7 2 - type name + - isAutogenerated: 1 + tree_list 2147483644 - chain + void_type 2147483643 - value + type_decl void 0:0 2147483642 - type name + - isAutogenerated: 1 + result_decl test43.cpp 66:5 2147483646 - function result + - isAutogenerated: 1 + pointer_type 2147483645 - result type + record_type 3 - nested type + type_decl Data1 test43.cpp 15:8 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483645 - decl size + - isUsed: 1 + parm_decl this test43.cpp 65:21 2147483646 - argument + - isAutogenerated: 1 + pointer_type 2147483645 - decl type + record_type 3 - nested type + type_decl Object1 test43.cpp 54:7 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483645 - parm size + return_expr test43.cpp 67:16 2147483646 - code + init_expr 2147483645 - operand + result_decl test43.cpp 66:5 2147483644 - operand + - isAutogenerated: 1 + pointer_type 2147483643 - result type + record_type 3 - nested type + type_decl Data1 test43.cpp 15:8 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483643 - decl size + component_ref test43.cpp 67:16 2147483644 - operand + indirect_ref 2147483643 - object + nop_expr 2147483642 - ref + - isUsed: 1 + parm_decl this test43.cpp 65:21 2147483641 - operand + - isAutogenerated: 1 + pointer_type 2147483640 - decl type + record_type 3 - nested type + type_decl Object1 test43.cpp 54:7 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483640 - parm size + field_decl tmp2 test43.cpp 57:12 2147483643 - field + - unsigned + integer_cst 64 2147483642 - decl size + pointer_type 5 - field type + record_type 3 - nested type + type_decl Data1 test43.cpp 15:8 2 - type name + - isAutogenerated: 1 +function_decl func1 test43.cpp 70:12 2147483647 +- isPublic: 1 + method_type 2147483646 - function type + pointer_type 2147483645 - method return type + record_type 3 - nested type + type_decl Data1 test43.cpp 15:8 2 - type name + - isAutogenerated: 1 + record_type 2147483645 - method base type + type_decl Object1 test43.cpp 54:7 2147483644 - type name + - isAutogenerated: 1 + tree_list 2147483645 - arg types + pointer_type 2147483644 - value + record_type 3 - nested type + type_decl Object1 test43.cpp 54:7 2 - type name + - isAutogenerated: 1 + tree_list 2147483644 - chain + pointer_type 2147483643 - value + record_type 3 - nested type + type_decl Data1 test43.cpp 15:8 2 - type name + - isAutogenerated: 1 + tree_list 2147483643 - chain + void_type 2147483642 - value + type_decl void 0:0 2147483641 - type name + - isAutogenerated: 1 + result_decl test43.cpp 71:5 2147483646 - function result + - isAutogenerated: 1 + pointer_type 2147483645 - result type + record_type 3 - nested type + type_decl Data1 test43.cpp 15:8 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483645 - decl size + - isUsed: 1 + parm_decl this test43.cpp 70:31 2147483646 - argument + - isAutogenerated: 1 + pointer_type 2147483645 - decl type + record_type 3 - nested type + type_decl Object1 test43.cpp 54:7 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483645 - parm size + parm_decl ptr1 test43.cpp 70:25 2147483646 - argument + pointer_type 2147483645 - decl type + record_type 3 - nested type + type_decl Data1 test43.cpp 15:8 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483645 - parm size + return_expr test43.cpp 72:27 2147483646 - code + init_expr 2147483645 - operand + result_decl test43.cpp 71:5 2147483644 - operand + - isAutogenerated: 1 + pointer_type 2147483643 - result type + record_type 3 - nested type + type_decl Data1 test43.cpp 15:8 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483643 - decl size + nop_expr 2147483644 - operand + cond_expr 2147483643 - operand + ne_expr 2147483642 - operand + var_decl k test43.cpp 47:5 2147483641 - operand + - isUsed: 1 + integer_cst 32 2147483640 - decl size + integer_type 2147483640 - var type + - precisionBits: 32 + - signed + type_decl int 0:0 2147483639 - type name + - isAutogenerated: 1 + integer_cst 32 2147483639 - type size + integer_cst -2147483648 2147483639 - min value + integer_cst 2147483647 2147483639 - max value + integer_cst 0 2147483641 - operand + component_ref test43.cpp 72:20 2147483642 - operand + indirect_ref 2147483641 - object + nop_expr 2147483640 - ref + - isUsed: 1 + parm_decl this test43.cpp 70:31 2147483639 - operand + - isAutogenerated: 1 + pointer_type 2147483638 - decl type + record_type 3 - nested type + type_decl Object1 test43.cpp 54:7 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483638 - parm size + field_decl tmp1 test43.cpp 56:12 2147483641 - field + - unsigned + integer_cst 64 2147483640 - decl size + pointer_type 5 - field type + record_type 3 - nested type + type_decl Data1 test43.cpp 15:8 2 - type name + - isAutogenerated: 1 + component_ref test43.cpp 72:27 2147483642 - operand + indirect_ref 2147483641 - object + nop_expr 2147483640 - ref + - isUsed: 1 + parm_decl this test43.cpp 70:31 2147483639 - operand + - isAutogenerated: 1 + pointer_type 2147483638 - decl type + record_type 3 - nested type + type_decl Object1 test43.cpp 54:7 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483638 - parm size + field_decl tmp2 test43.cpp 57:12 2147483641 - field + - unsigned + integer_cst 64 2147483640 - decl size + pointer_type 5 - field type + record_type 3 - nested type + type_decl Data1 test43.cpp 15:8 2 - type name + - isAutogenerated: 1 +function_decl func2 test43.cpp 75:12 2147483647 +- isPublic: 1 + method_type 2147483646 - function type + pointer_type 2147483645 - method return type + record_type 3 - nested type + type_decl Data1 test43.cpp 15:8 2 - type name + - isAutogenerated: 1 + record_type 2147483645 - method base type + type_decl Object1 test43.cpp 54:7 2147483644 - type name + - isAutogenerated: 1 + tree_list 2147483645 - arg types + pointer_type 2147483644 - value + record_type 3 - nested type + type_decl Object1 test43.cpp 54:7 2 - type name + - isAutogenerated: 1 + tree_list 2147483644 - chain + pointer_type 2147483643 - value + record_type 3 - nested type + type_decl Data1 test43.cpp 15:8 2 - type name + - isAutogenerated: 1 + tree_list 2147483643 - chain + void_type 2147483642 - value + type_decl void 0:0 2147483641 - type name + - isAutogenerated: 1 + result_decl test43.cpp 76:5 2147483646 - function result + - isAutogenerated: 1 + pointer_type 2147483645 - result type + record_type 3 - nested type + type_decl Data1 test43.cpp 15:8 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483645 - decl size + - isUsed: 1 + parm_decl this test43.cpp 75:31 2147483646 - argument + - isAutogenerated: 1 + pointer_type 2147483645 - decl type + record_type 3 - nested type + type_decl Object1 test43.cpp 54:7 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483645 - parm size + parm_decl ptr1 test43.cpp 75:25 2147483646 - argument + pointer_type 2147483645 - decl type + record_type 3 - nested type + type_decl Data1 test43.cpp 15:8 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483645 - parm size + return_expr test43.cpp 77:16 2147483646 - code + init_expr 2147483645 - operand + result_decl test43.cpp 76:5 2147483644 - operand + - isAutogenerated: 1 + pointer_type 2147483643 - result type + record_type 3 - nested type + type_decl Data1 test43.cpp 15:8 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483643 - decl size + nop_expr 2147483644 - operand + component_ref test43.cpp 77:16 2147483643 - operand + indirect_ref 2147483642 - object + nop_expr 2147483641 - ref + - isUsed: 1 + parm_decl this test43.cpp 75:31 2147483640 - operand + - isAutogenerated: 1 + pointer_type 2147483639 - decl type + record_type 3 - nested type + type_decl Object1 test43.cpp 54:7 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483639 - parm size + field_decl tmp1 test43.cpp 56:12 2147483642 - field + - unsigned + integer_cst 64 2147483641 - decl size + pointer_type 5 - field type + record_type 3 - nested type + type_decl Data1 test43.cpp 15:8 2 - type name + - isAutogenerated: 1 +function_decl func3 test43.cpp 80:12 2147483647 +- isPublic: 1 + method_type 2147483646 - function type + pointer_type 2147483645 - method return type + record_type 3 - nested type + type_decl Data1 test43.cpp 15:8 2 - type name + - isAutogenerated: 1 + record_type 2147483645 - method base type + type_decl Object1 test43.cpp 54:7 2147483644 - type name + - isAutogenerated: 1 + tree_list 2147483645 - arg types + pointer_type 2147483644 - value + record_type 3 - nested type + type_decl Object1 test43.cpp 54:7 2 - type name + - isAutogenerated: 1 + tree_list 2147483644 - chain + pointer_type 2147483643 - value + record_type 3 - nested type + type_decl Data1 test43.cpp 15:8 2 - type name + - isAutogenerated: 1 + tree_list 2147483643 - chain + void_type 2147483642 - value + type_decl void 0:0 2147483641 - type name + - isAutogenerated: 1 + result_decl test43.cpp 81:5 2147483646 - function result + - isAutogenerated: 1 + pointer_type 2147483645 - result type + record_type 3 - nested type + type_decl Data1 test43.cpp 15:8 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483645 - decl size + - isUsed: 1 + parm_decl this test43.cpp 80:31 2147483646 - argument + - isAutogenerated: 1 + pointer_type 2147483645 - decl type + record_type 3 - nested type + type_decl Object1 test43.cpp 54:7 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483645 - parm size + parm_decl ptr1 test43.cpp 80:25 2147483646 - argument + pointer_type 2147483645 - decl type + record_type 3 - nested type + type_decl Data1 test43.cpp 15:8 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483645 - parm size + return_expr test43.cpp 82:23 2147483646 - code + init_expr 2147483645 - operand + result_decl test43.cpp 81:5 2147483644 - operand + - isAutogenerated: 1 + pointer_type 2147483643 - result type + record_type 3 - nested type + type_decl Data1 test43.cpp 15:8 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483643 - decl size + pointer_plus_expr test43.cpp 82:23 2147483644 - operand + nop_expr 2147483643 - operand + component_ref test43.cpp 82:17 2147483642 - operand + indirect_ref 2147483641 - object + nop_expr 2147483640 - ref + - isUsed: 1 + parm_decl this test43.cpp 80:31 2147483639 - operand + - isAutogenerated: 1 + pointer_type 2147483638 - decl type + record_type 3 - nested type + type_decl Object1 test43.cpp 54:7 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483638 - parm size + field_decl tmp1 test43.cpp 56:12 2147483641 - field + - unsigned + integer_cst 64 2147483640 - decl size + pointer_type 5 - field type + record_type 3 - nested type + type_decl Data1 test43.cpp 15:8 2 - type name + - isAutogenerated: 1 + integer_cst 72 2147483643 - operand diff --git a/test/test43-02.txt b/test/test43-02.txt new file mode 100644 index 0000000..b004c5a --- /dev/null +++ b/test/test43-02.txt @@ -0,0 +1,11 @@ +getData3: +getData2: +getData3: +getData4: +getData5: +getData6: +getData1: +getData2: +func1: pointer_type ptr1, +func2: pointer_type ptr1, +func3: pointer_type ptr1, diff --git a/test/test43-03.txt b/test/test43-03.txt new file mode 100644 index 0000000..749cf94 --- /dev/null +++ b/test/test43-03.txt @@ -0,0 +1,255 @@ +function_decl getData3: +return_expr : +init_expr : +result_decl : +pointer_type : +record_type : +type_decl Data1: +integer_cst 64: +component_ref : +indirect_ref : +parm_decl this: +pointer_type : +record_type : +type_decl Data2: +integer_cst 64: +field_decl ptrval: +integer_cst 64: +pointer_type : +record_type : +type_decl Data1: +function_decl getData2: +return_expr : +init_expr : +result_decl : +pointer_type : +record_type : +type_decl Data1: +integer_cst 64: +component_ref : +indirect_ref : +parm_decl this: +pointer_type : +record_type : +type_decl Data1: +integer_cst 64: +field_decl ptrval: +integer_cst 64: +pointer_type : +record_type : +type_decl Data1: +function_decl getData3: +statement_list : +cleanup_point_expr : +expr_stmt : +convert_expr : +modify_expr : +component_ref : +indirect_ref : +parm_decl this: +pointer_type : +record_type : +type_decl Data1: +integer_cst 64: +field_decl val: +integer_cst 32: +integer_type : +type_decl int: +integer_cst 32: +integer_cst -2147483648: +integer_cst 2147483647: +indirect_ref : +parm_decl k: +reference_type : +integer_type : +type_decl int: +integer_cst 32: +integer_cst -2147483648: +integer_cst 2147483647: +integer_cst 64: +return_expr : +init_expr : +result_decl : +pointer_type : +record_type : +type_decl Data1: +integer_cst 64: +component_ref : +indirect_ref : +parm_decl this: +pointer_type : +record_type : +type_decl Data1: +integer_cst 64: +field_decl ptrval: +integer_cst 64: +pointer_type : +record_type : +type_decl Data1: +function_decl getData4: +return_expr : +init_expr : +result_decl : +pointer_type : +record_type : +type_decl Data1: +integer_cst 64: +integer_cst 0: +function_decl getData5: +return_expr : +init_expr : +result_decl : +pointer_type : +record_type : +type_decl Data2: +integer_cst 64: +addr_expr : +component_ref : +indirect_ref : +parm_decl this: +pointer_type : +record_type : +type_decl Data1: +integer_cst 64: +field_decl perm: +integer_cst 256: +record_type : +type_decl Data2: +function_decl getData6: +return_expr : +init_expr : +result_decl : +pointer_type : +record_type : +type_decl Data1: +integer_cst 64: +integer_cst 0: +function_decl getData1: +return_expr : +init_expr : +result_decl : +pointer_type : +record_type : +type_decl Data1: +integer_cst 64: +component_ref : +indirect_ref : +parm_decl this: +pointer_type : +record_type : +type_decl Object1: +integer_cst 64: +field_decl tmp2: +integer_cst 64: +pointer_type : +record_type : +type_decl Data1: +function_decl getData2: +return_expr : +init_expr : +result_decl : +pointer_type : +record_type : +type_decl Data1: +integer_cst 64: +component_ref : +indirect_ref : +parm_decl this: +pointer_type : +record_type : +type_decl Object1: +integer_cst 64: +field_decl tmp2: +integer_cst 64: +pointer_type : +record_type : +type_decl Data1: +function_decl func1: +return_expr : ptr1, +init_expr : ptr1, +result_decl : ptr1, +pointer_type : ptr1, +record_type : ptr1, +type_decl Data1: ptr1, +integer_cst 64: ptr1, +cond_expr : ptr1, +ne_expr : ptr1, +integer_cst 0: ptr1, +var_decl k: ptr1, +integer_cst 32: ptr1, +integer_type : ptr1, +type_decl int: ptr1, +integer_cst 32: ptr1, +integer_cst -2147483648: ptr1, +integer_cst 2147483647: ptr1, +integer_cst 0: ptr1, +component_ref : ptr1, +indirect_ref : ptr1, +parm_decl this: ptr1, +pointer_type : ptr1, +record_type : ptr1, +type_decl Object1: ptr1, +integer_cst 64: ptr1, +field_decl tmp1: ptr1, +integer_cst 64: ptr1, +pointer_type : ptr1, +record_type : ptr1, +type_decl Data1: ptr1, +component_ref : ptr1, +indirect_ref : ptr1, +parm_decl this: ptr1, +pointer_type : ptr1, +record_type : ptr1, +type_decl Object1: ptr1, +integer_cst 64: ptr1, +field_decl tmp2: ptr1, +integer_cst 64: ptr1, +pointer_type : ptr1, +record_type : ptr1, +type_decl Data1: ptr1, +function_decl func2: +return_expr : ptr1, +init_expr : ptr1, +result_decl : ptr1, +pointer_type : ptr1, +record_type : ptr1, +type_decl Data1: ptr1, +integer_cst 64: ptr1, +component_ref : ptr1, +indirect_ref : ptr1, +parm_decl this: ptr1, +pointer_type : ptr1, +record_type : ptr1, +type_decl Object1: ptr1, +integer_cst 64: ptr1, +field_decl tmp1: ptr1, +integer_cst 64: ptr1, +pointer_type : ptr1, +record_type : ptr1, +type_decl Data1: ptr1, +function_decl func3: +return_expr : ptr1, +init_expr : ptr1, +result_decl : ptr1, +pointer_type : ptr1, +record_type : ptr1, +type_decl Data1: ptr1, +integer_cst 64: ptr1, +pointer_plus_expr : ptr1, +test43.cpp: In member function 'Data1* Object1::func3(Data1*) const': +test43.cpp:82:23: warning: Using variable 'this->tmp1' without checking for null pointer + return &tmp1[1]; + ^ +component_ref : ptr1, +indirect_ref : ptr1, +parm_decl this: ptr1, +pointer_type : ptr1, +record_type : ptr1, +type_decl Object1: ptr1, +integer_cst 64: ptr1, +field_decl tmp1: ptr1, +integer_cst 64: ptr1, +pointer_type : ptr1, +record_type : ptr1, +type_decl Data1: ptr1, +integer_cst 72: ptr1, diff --git a/test/test43-04.txt b/test/test43-04.txt new file mode 100644 index 0000000..4e97063 --- /dev/null +++ b/test/test43-04.txt @@ -0,0 +1,4 @@ +test43.cpp: In member function 'Data1* Object1::func3(Data1*) const': +test43.cpp:82:23: warning: Using variable 'this->tmp1' without checking for null pointer + return &tmp1[1]; + ^ diff --git a/test/test43-05.txt b/test/test43-05.txt new file mode 100644 index 0000000..4e97063 --- /dev/null +++ b/test/test43-05.txt @@ -0,0 +1,4 @@ +test43.cpp: In member function 'Data1* Object1::func3(Data1*) const': +test43.cpp:82:23: warning: Using variable 'this->tmp1' without checking for null pointer + return &tmp1[1]; + ^ diff --git a/test/test43.cpp b/test/test43.cpp new file mode 100644 index 0000000..dd44f0a --- /dev/null +++ b/test/test43.cpp @@ -0,0 +1,84 @@ +struct Data1; +struct Data2; + +struct Data2 +{ + int val; + Data1 *ptrval; + int arr[3]; + Data1 *getData3() + { + return ptrval; + } +}; + +struct Data1 +{ + int val; + Data1 *ptrval; + Data2 perm; + int arr[3]; + virtual ~Data1(); + + Data1 *getData2() + { + return ptrval; + } + + virtual Data1 *getData3(int &k) + { + val = k; + return ptrval; + } + static Data1 *getData4() + { + return 0; + } + Data2 *getData5() __attribute__((returns_nonnull)) + { + return &perm; + } + virtual Data1 *getData6() + { + return 0; + } +}; + +int k; + +Data1 *gptr1; +Data1 *gptr2 __attribute__((nonnullpointer)); + +void paranuckerInternalTest(const char *action, const char *collection, const char *values); + +class Object1 +{ + Data1 *tmp1; + Data1 *tmp2; + Data1 *tmp3 __attribute__((nonnullpointer)); + + Data1 *getData1() + { + return tmp2; + } + + Data1 *getData2() + { + return tmp2; + } + + Data1 *func1(Data1 *ptr1) const + { + return k ? tmp1 : tmp2; + } + + Data1 *func2(Data1 *ptr1) const + { + return tmp1; + } + + Data1 *func3(Data1 *ptr1) const + { + return &tmp1[1]; + } +}; -- cgit v1.2.3-60-g2f50