diff options
-rw-r--r-- | test/Makefile | 15 | ||||
-rw-r--r-- | test/test42-01.txt | 558 | ||||
-rw-r--r-- | test/test42-02.txt | 8 | ||||
-rw-r--r-- | test/test42-03.txt | 197 | ||||
-rw-r--r-- | test/test42-04.txt | 4 | ||||
-rw-r--r-- | test/test42-05.txt | 4 | ||||
-rw-r--r-- | test/test42.cpp | 81 |
7 files changed, 866 insertions, 1 deletions
diff --git a/test/Makefile b/test/Makefile index 176276e..b5ff3e8 100644 --- a/test/Makefile +++ b/test/Makefile @@ -45,7 +45,8 @@ TESTS38 = $(call TEST,38,5) TESTS39 = $(call TEST,39,5) TESTS40 = $(call TEST,40,5) TESTS41 = $(call TEST,41,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 +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 ALLTESTS = $(foreach num,$(TESTNUMBERS),test$(num) ${TESTS$(num)}) .PHONY: ${ALLTESTS} ${CRASHES} all crashes @@ -512,6 +513,18 @@ test41-04: test41-05: $(call CMDXX,detectnullpointers,test41.cpp,test41-05.txt,-O2 -std=c++0x -Wall -Wnonnull) +test42: ${TESTS42} +test42-01: + $(call CMDXX,dump,test42.cpp,test42-01.txt,-std=c++0x) +test42-02: + $(call CMDXX,findargs,test42.cpp,test42-02.txt,-std=c++0x) +test42-03: + $(call CMDXX,dumpnullpointers,test42.cpp,test42-03.txt,-std=c++0x) +test42-04: + $(call CMDXX,detectnullpointers,test42.cpp,test42-04.txt,-std=c++0x) +test42-05: + $(call CMDXX,detectnullpointers,test42.cpp,test42-05.txt,-O2 -std=c++0x -Wall -Wnonnull) + crashtest01: $(call CMDXX,dump,crashtest01.h,crashtest01-01.txt) crashtest02: diff --git a/test/test42-01.txt b/test/test42-01.txt new file mode 100644 index 0000000..136927d --- /dev/null +++ b/test/test42-01.txt @@ -0,0 +1,558 @@ +function_decl getData3 test42.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 test42.cpp 1:8 2 - type name + - isAutogenerated: 1 + record_type 2147483645 - method base type + type_decl Data2 test42.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 test42.cpp 4:8 2 - type name + - isAutogenerated: 1 + tree_list 2147483644 - chain + void_type 2147483643 - value + type_decl void <built-in> 0:0 2147483642 - type name + - isAutogenerated: 1 + result_decl test42.cpp 10:5 2147483646 - function result + - isAutogenerated: 1 + pointer_type 2147483645 - result type + record_type 3 - nested type + type_decl Data1 test42.cpp 1:8 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483645 - decl size + - isUsed: 1 + parm_decl this test42.cpp 9:21 2147483646 - argument + - isAutogenerated: 1 + pointer_type 2147483645 - decl type + record_type 3 - nested type + type_decl Data2 test42.cpp 4:8 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483645 - parm size + return_expr test42.cpp 11:16 2147483646 - code + init_expr 2147483645 - operand + result_decl test42.cpp 10:5 2147483644 - operand + - isAutogenerated: 1 + pointer_type 2147483643 - result type + record_type 3 - nested type + type_decl Data1 test42.cpp 1:8 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483643 - decl size + component_ref test42.cpp 11:16 2147483644 - operand + indirect_ref 2147483643 - object + nop_expr 2147483642 - ref + - isUsed: 1 + parm_decl this test42.cpp 9:21 2147483641 - operand + - isAutogenerated: 1 + pointer_type 2147483640 - decl type + record_type 3 - nested type + type_decl Data2 test42.cpp 4:8 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483640 - parm size + field_decl ptrval test42.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 test42.cpp 1:8 2 - type name + - isAutogenerated: 1 +function_decl getData3 test42.cpp 22: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 test42.cpp 15:8 2 - type name + - isAutogenerated: 1 + record_type 2147483645 - method base type + type_decl Data1 test42.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 test42.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 <built-in> 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 <built-in> 0:0 2147483641 - type name + - isAutogenerated: 1 + result_decl test42.cpp 23:5 2147483646 - function result + - isAutogenerated: 1 + pointer_type 2147483645 - result type + record_type 3 - nested type + type_decl Data1 test42.cpp 15:8 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483645 - decl size + - isUsed: 1 + parm_decl this test42.cpp 22:35 2147483646 - argument + - isAutogenerated: 1 + pointer_type 2147483645 - decl type + record_type 3 - nested type + type_decl Data1 test42.cpp 15:8 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483645 - parm size + - isUsed: 1 + parm_decl k test42.cpp 22:34 2147483646 - argument + reference_type 2147483645 - decl type + integer_type 2147483644 - nested type + - precisionBits: 32 + - signed + type_decl int <built-in> 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 test42.cpp 24:16 2147483645 - statement + expr_stmt test42.cpp 24:16 2147483644 - operand + convert_expr 2147483643 - expresssion + modify_expr 2147483642 - operand + component_ref test42.cpp 24:9 2147483641 - operand + indirect_ref 2147483640 - object + nop_expr 2147483639 - ref + - isUsed: 1 + parm_decl this test42.cpp 22:35 2147483638 - operand + - isAutogenerated: 1 + pointer_type 2147483637 - decl type + record_type 3 - nested type + type_decl Data1 test42.cpp 15:8 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483637 - parm size + field_decl val test42.cpp 17:9 2147483640 - field + - signed + integer_cst 32 2147483639 - decl size + integer_type 5 - field type + - precisionBits: 32 + - signed + type_decl int <built-in> 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 test42.cpp 22:34 2147483640 - ref + reference_type 2147483639 - decl type + integer_type 2147483638 - nested type + - precisionBits: 32 + - signed + type_decl int <built-in> 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 test42.cpp 25:16 2147483645 - statement + init_expr 2147483644 - operand + result_decl test42.cpp 23:5 2147483643 - operand + - isAutogenerated: 1 + pointer_type 2147483642 - result type + record_type 3 - nested type + type_decl Data1 test42.cpp 15:8 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483642 - decl size + component_ref test42.cpp 25:16 2147483643 - operand + indirect_ref 2147483642 - object + nop_expr 2147483641 - ref + - isUsed: 1 + parm_decl this test42.cpp 22:35 2147483640 - operand + - isAutogenerated: 1 + pointer_type 2147483639 - decl type + record_type 3 - nested type + type_decl Data1 test42.cpp 15:8 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483639 - parm size + field_decl ptrval test42.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 test42.cpp 15:8 2 - type name + - isAutogenerated: 1 +function_decl getData4 test42.cpp 27:19 2147483647 +- isPublic: 1 + function_type 2147483646 - function type + pointer_type 2147483645 - function return type + record_type 3 - nested type + type_decl Data1 test42.cpp 15:8 2 - type name + - isAutogenerated: 1 + tree_list 2147483645 - arg types + void_type 2147483644 - value + type_decl void <built-in> 0:0 2147483643 - type name + - isAutogenerated: 1 + result_decl test42.cpp 28:5 2147483646 - function result + - isAutogenerated: 1 + pointer_type 2147483645 - result type + record_type 3 - nested type + type_decl Data1 test42.cpp 15:8 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483645 - decl size + return_expr test42.cpp 29:16 2147483646 - code + init_expr 2147483645 - operand + result_decl test42.cpp 28:5 2147483644 - operand + - isAutogenerated: 1 + pointer_type 2147483643 - result type + record_type 3 - nested type + type_decl Data1 test42.cpp 15:8 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483643 - decl size + integer_cst 0 2147483644 - operand +function_decl getData5 test42.cpp 31: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 test42.cpp 4:8 2 - type name + - isAutogenerated: 1 + record_type 2147483645 - method base type + type_decl Data1 test42.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 test42.cpp 15:8 2 - type name + - isAutogenerated: 1 + tree_list 2147483644 - chain + void_type 2147483643 - value + type_decl void <built-in> 0:0 2147483642 - type name + - isAutogenerated: 1 + result_decl test42.cpp 32:5 2147483646 - function result + - isAutogenerated: 1 + pointer_type 2147483645 - result type + record_type 3 - nested type + type_decl Data2 test42.cpp 4:8 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483645 - decl size + - isUsed: 1 + parm_decl this test42.cpp 31:54 2147483646 - argument + - isAutogenerated: 1 + pointer_type 2147483645 - decl type + record_type 3 - nested type + type_decl Data1 test42.cpp 15:8 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483645 - parm size + return_expr test42.cpp 33:17 2147483646 - code + init_expr 2147483645 - operand + result_decl test42.cpp 32:5 2147483644 - operand + - isAutogenerated: 1 + pointer_type 2147483643 - result type + record_type 3 - nested type + type_decl Data2 test42.cpp 4:8 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483643 - decl size + addr_expr 2147483644 - operand + component_ref test42.cpp 33:17 2147483643 - operand + indirect_ref 2147483642 - object + nop_expr 2147483641 - ref + - isUsed: 1 + parm_decl this test42.cpp 31:54 2147483640 - operand + - isAutogenerated: 1 + pointer_type 2147483639 - decl type + record_type 3 - nested type + type_decl Data1 test42.cpp 15:8 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483639 - parm size + field_decl perm test42.cpp 19:11 2147483642 - field + - signed + integer_cst 256 2147483641 - decl size + record_type 5 - field type + type_decl Data2 test42.cpp 4:8 4 - type name + - isAutogenerated: 1 +function_decl getData1 test42.cpp 50:12 2147483647 +- isPublic: 1 + method_type 2147483646 - function type + pointer_type 2147483645 - method return type + record_type 3 - nested type + type_decl Data1 test42.cpp 15:8 2 - type name + - isAutogenerated: 1 + record_type 2147483645 - method base type + type_decl Object1 test42.cpp 44:7 2147483644 - type name + - isAutogenerated: 1 + tree_list 2147483645 - arg types + pointer_type 2147483644 - value + record_type 3 - nested type + type_decl Object1 test42.cpp 44:7 2 - type name + - isAutogenerated: 1 + tree_list 2147483644 - chain + void_type 2147483643 - value + type_decl void <built-in> 0:0 2147483642 - type name + - isAutogenerated: 1 + result_decl test42.cpp 51:5 2147483646 - function result + - isAutogenerated: 1 + pointer_type 2147483645 - result type + record_type 3 - nested type + type_decl Data1 test42.cpp 15:8 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483645 - decl size + - isUsed: 1 + parm_decl this test42.cpp 50:21 2147483646 - argument + - isAutogenerated: 1 + pointer_type 2147483645 - decl type + record_type 3 - nested type + type_decl Object1 test42.cpp 44:7 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483645 - parm size + return_expr test42.cpp 52:16 2147483646 - code + init_expr 2147483645 - operand + result_decl test42.cpp 51:5 2147483644 - operand + - isAutogenerated: 1 + pointer_type 2147483643 - result type + record_type 3 - nested type + type_decl Data1 test42.cpp 15:8 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483643 - decl size + component_ref test42.cpp 52:16 2147483644 - operand + indirect_ref 2147483643 - object + nop_expr 2147483642 - ref + - isUsed: 1 + parm_decl this test42.cpp 50:21 2147483641 - operand + - isAutogenerated: 1 + pointer_type 2147483640 - decl type + record_type 3 - nested type + type_decl Object1 test42.cpp 44:7 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483640 - parm size + field_decl tmp2 test42.cpp 47:12 2147483643 - field + - unsigned + integer_cst 64 2147483642 - decl size + pointer_type 5 - field type + record_type 3 - nested type + type_decl Data1 test42.cpp 15:8 2 - type name + - isAutogenerated: 1 +function_decl getData2 test42.cpp 55:12 2147483647 +- isPublic: 1 + method_type 2147483646 - function type + pointer_type 2147483645 - method return type + record_type 3 - nested type + type_decl Data1 test42.cpp 15:8 2 - type name + - isAutogenerated: 1 + record_type 2147483645 - method base type + type_decl Object1 test42.cpp 44:7 2147483644 - type name + - isAutogenerated: 1 + tree_list 2147483645 - arg types + pointer_type 2147483644 - value + record_type 3 - nested type + type_decl Object1 test42.cpp 44:7 2 - type name + - isAutogenerated: 1 + tree_list 2147483644 - chain + void_type 2147483643 - value + type_decl void <built-in> 0:0 2147483642 - type name + - isAutogenerated: 1 + result_decl test42.cpp 56:5 2147483646 - function result + - isAutogenerated: 1 + pointer_type 2147483645 - result type + record_type 3 - nested type + type_decl Data1 test42.cpp 15:8 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483645 - decl size + - isUsed: 1 + parm_decl this test42.cpp 55:21 2147483646 - argument + - isAutogenerated: 1 + pointer_type 2147483645 - decl type + record_type 3 - nested type + type_decl Object1 test42.cpp 44:7 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483645 - parm size + return_expr test42.cpp 57:16 2147483646 - code + init_expr 2147483645 - operand + result_decl test42.cpp 56:5 2147483644 - operand + - isAutogenerated: 1 + pointer_type 2147483643 - result type + record_type 3 - nested type + type_decl Data1 test42.cpp 15:8 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483643 - decl size + component_ref test42.cpp 57:16 2147483644 - operand + indirect_ref 2147483643 - object + nop_expr 2147483642 - ref + - isUsed: 1 + parm_decl this test42.cpp 55:21 2147483641 - operand + - isAutogenerated: 1 + pointer_type 2147483640 - decl type + record_type 3 - nested type + type_decl Object1 test42.cpp 44:7 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483640 - parm size + field_decl tmp2 test42.cpp 47:12 2147483643 - field + - unsigned + integer_cst 64 2147483642 - decl size + pointer_type 5 - field type + record_type 3 - nested type + type_decl Data1 test42.cpp 15:8 2 - type name + - isAutogenerated: 1 +function_decl func1 test42.cpp 60:10 2147483647 +- isPublic: 1 + method_type 2147483646 - function type + void_type 2147483645 - method return type + type_decl void <built-in> 0:0 2147483644 - type name + - isAutogenerated: 1 + record_type 2147483645 - method base type + type_decl Object1 test42.cpp 44:7 2147483644 - type name + - isAutogenerated: 1 + tree_list 2147483645 - arg types + pointer_type 2147483644 - value + record_type 3 - nested type + type_decl Object1 test42.cpp 44:7 2 - type name + - isAutogenerated: 1 + tree_list 2147483644 - chain + pointer_type 2147483643 - value + record_type 3 - nested type + type_decl Data1 test42.cpp 15:8 2 - type name + - isAutogenerated: 1 + tree_list 2147483643 - chain + void_type 2147483642 - value + type_decl void <built-in> 0:0 2147483641 - type name + - isAutogenerated: 1 + result_decl test42.cpp 61:5 2147483646 - function result + - isAutogenerated: 1 + void_type 2147483645 - result type + type_decl void <built-in> 0:0 2147483644 - type name + - isAutogenerated: 1 + - isUsed: 1 + parm_decl this test42.cpp 60:29 2147483646 - argument + - isAutogenerated: 1 + pointer_type 2147483645 - decl type + record_type 3 - nested type + type_decl Object1 test42.cpp 44:7 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483645 - parm size + parm_decl ptr1 test42.cpp 60:23 2147483646 - argument + pointer_type 2147483645 - decl type + record_type 3 - nested type + type_decl Data1 test42.cpp 15:8 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483645 - parm size + cleanup_point_expr test42.cpp 62:24 2147483646 - code + expr_stmt test42.cpp 62:24 2147483645 - operand + convert_expr 2147483644 - expresssion + modify_expr 2147483643 - operand + component_ref test42.cpp 62:15 2147483642 - operand + indirect_ref 2147483641 - object + nop_expr 2147483640 - ref + component_ref test42.cpp 62:9 2147483639 - operand + indirect_ref 2147483638 - object + nop_expr 2147483637 - ref + - isUsed: 1 + parm_decl this test42.cpp 60:29 2147483636 - operand + - isAutogenerated: 1 + pointer_type 2147483635 - decl type + record_type 3 - nested type + type_decl Object1 test42.cpp 44:7 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483635 - parm size + field_decl tmp1 test42.cpp 46:12 2147483638 - field + - unsigned + integer_cst 64 2147483637 - decl size + pointer_type 5 - field type + record_type 3 - nested type + type_decl Data1 test42.cpp 15:8 2 - type name + - isAutogenerated: 1 + field_decl val test42.cpp 17:9 2147483641 - field + - signed + integer_cst 32 2147483640 - decl size + integer_type 5 - field type + - precisionBits: 32 + - signed + type_decl int <built-in> 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 + integer_cst 100 2147483642 - operand +function_decl func2 test42.cpp 65:10 2147483647 +- isPublic: 1 + method_type 2147483646 - function type + void_type 2147483645 - method return type + type_decl void <built-in> 0:0 2147483644 - type name + - isAutogenerated: 1 + record_type 2147483645 - method base type + type_decl Object1 test42.cpp 44:7 2147483644 - type name + - isAutogenerated: 1 + tree_list 2147483645 - arg types + pointer_type 2147483644 - value + record_type 3 - nested type + type_decl Object1 test42.cpp 44:7 2 - type name + - isAutogenerated: 1 + tree_list 2147483644 - chain + pointer_type 2147483643 - value + record_type 3 - nested type + type_decl Data1 test42.cpp 15:8 2 - type name + - isAutogenerated: 1 + tree_list 2147483643 - chain + void_type 2147483642 - value + type_decl void <built-in> 0:0 2147483641 - type name + - isAutogenerated: 1 + result_decl test42.cpp 66:5 2147483646 - function result + - isAutogenerated: 1 + void_type 2147483645 - result type + type_decl void <built-in> 0:0 2147483644 - type name + - isAutogenerated: 1 + - isUsed: 1 + parm_decl this test42.cpp 65:29 2147483646 - argument + - isAutogenerated: 1 + pointer_type 2147483645 - decl type + record_type 3 - nested type + type_decl Object1 test42.cpp 44:7 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483645 - parm size + parm_decl ptr1 test42.cpp 65:23 2147483646 - argument + pointer_type 2147483645 - decl type + record_type 3 - nested type + type_decl Data1 test42.cpp 15:8 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483645 - parm size + cleanup_point_expr test42.cpp 67:24 2147483646 - code + expr_stmt test42.cpp 67:24 2147483645 - operand + convert_expr 2147483644 - expresssion + modify_expr 2147483643 - operand + component_ref test42.cpp 67:15 2147483642 - operand + indirect_ref 2147483641 - object + nop_expr 2147483640 - ref + component_ref test42.cpp 67:9 2147483639 - operand + indirect_ref 2147483638 - object + nop_expr 2147483637 - ref + - isUsed: 1 + parm_decl this test42.cpp 65:29 2147483636 - operand + - isAutogenerated: 1 + pointer_type 2147483635 - decl type + record_type 3 - nested type + type_decl Object1 test42.cpp 44:7 2 - type name + - isAutogenerated: 1 + integer_cst 64 2147483635 - parm size + field_decl tmp3 test42.cpp 48:47 2147483638 - field + - unsigned + tree_list 2147483637 - attribute + identifier_node nonnullpointer 2147483636 - purpose + integer_cst 64 2147483637 - decl size + pointer_type 5 - field type + record_type 3 - nested type + type_decl Data2 test42.cpp 4:8 2 - type name + - isAutogenerated: 1 + field_decl val test42.cpp 6:9 2147483641 - field + - signed + integer_cst 32 2147483640 - decl size + integer_type 5 - field type + - precisionBits: 32 + - signed + type_decl int <built-in> 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 + integer_cst 100 2147483642 - operand diff --git a/test/test42-02.txt b/test/test42-02.txt new file mode 100644 index 0000000..b5db6a6 --- /dev/null +++ b/test/test42-02.txt @@ -0,0 +1,8 @@ +getData3: +getData3: +getData4: +getData5: +getData1: +getData2: +func1: pointer_type ptr1, +func2: pointer_type ptr1, diff --git a/test/test42-03.txt b/test/test42-03.txt new file mode 100644 index 0000000..3e5e48b --- /dev/null +++ b/test/test42-03.txt @@ -0,0 +1,197 @@ +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 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 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: +cleanup_point_expr : ptr1, +expr_stmt : ptr1, +convert_expr : ptr1, +modify_expr : ptr1, +test42.cpp: In member function 'void Object1::func1(Data1*) const': +test42.cpp:62:24: warning: Using variable 'this->tmp1' without checking for null pointer + tmp1->val = 100; + ^ +component_ref : ptr1, +indirect_ref : 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, +field_decl val: 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 100: ptr1, +function_decl func2: +cleanup_point_expr : ptr1, +expr_stmt : ptr1, +convert_expr : ptr1, +modify_expr : ptr1, +component_ref : ptr1, +indirect_ref : 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 tmp3: ptr1, +tree_list : ptr1, +identifier_node nonnullpointer: ptr1, +integer_cst 64: ptr1, +pointer_type : ptr1, +record_type : ptr1, +type_decl Data2: ptr1, +field_decl val: 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 100: ptr1, diff --git a/test/test42-04.txt b/test/test42-04.txt new file mode 100644 index 0000000..6cb26c8 --- /dev/null +++ b/test/test42-04.txt @@ -0,0 +1,4 @@ +test42.cpp: In member function 'void Object1::func1(Data1*) const': +test42.cpp:62:24: warning: Using variable 'this->tmp1' without checking for null pointer + tmp1->val = 100; + ^ diff --git a/test/test42-05.txt b/test/test42-05.txt new file mode 100644 index 0000000..6cb26c8 --- /dev/null +++ b/test/test42-05.txt @@ -0,0 +1,4 @@ +test42.cpp: In member function 'void Object1::func1(Data1*) const': +test42.cpp:62:24: warning: Using variable 'this->tmp1' without checking for null pointer + tmp1->val = 100; + ^ diff --git a/test/test42.cpp b/test/test42.cpp new file mode 100644 index 0000000..f2ab4f7 --- /dev/null +++ b/test/test42.cpp @@ -0,0 +1,81 @@ +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(); + virtual Data1 *getData3(int &k) + { + val = k; + return ptrval; + } + static Data1 *getData4() + { + return 0; + } + Data2 *getData5() __attribute__((returns_nonnull)) + { + return &perm; + } +}; + +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; + Data2 *tmp3 __attribute__((nonnullpointer)); + + Data1 *getData1() + { + return tmp2; + } + + Data1 *getData2() + { + return tmp2; + } + + void func1(Data1 *ptr1) const + { + tmp1->val = 100; + } + + void func2(Data1 *ptr1) const + { + tmp3->val = 100; + } + +/* + void func3(Data1 *ptr1) const + { + gptr1->val = 100; + } + + void func4(Data1 *ptr1) const + { + gptr2->val = 100; + } +*/ +}; |