Skip to content

Commit f791b0e

Browse files
committed
C++: Model for smart pointer destructors
1 parent b6cf64c commit f791b0e

File tree

4 files changed

+106
-105
lines changed

4 files changed

+106
-105
lines changed

cpp/ql/lib/semmle/code/cpp/models/implementations/SmartPointer.qll

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,3 +168,58 @@ private class SmartPtrSetterFunction extends MemberFunction, AliasFunction, Side
168168
)
169169
}
170170
}
171+
172+
/** A destructor assocaited with a smart pointer. */
173+
private class SmartPtrDestructor extends Destructor, SideEffectFunction, AliasFunction {
174+
SmartPtr declaringType;
175+
176+
SmartPtrDestructor() {
177+
declaringType = this.getDeclaringType() and not this.isFromUninstantiatedTemplate(_)
178+
}
179+
180+
/**
181+
* Gets the destructor associated with the base type of this smart pointer.
182+
*/
183+
private Destructor getBaseTypeDestructor() {
184+
// TODO: Check if this is join ordered correctly.
185+
result.getDeclaringType() = declaringType.getBaseType()
186+
}
187+
188+
override predicate hasOnlySpecificReadSideEffects() {
189+
this.getBaseTypeDestructor().(SideEffectFunction).hasOnlySpecificReadSideEffects()
190+
or
191+
// If there's no declared destructor for the base type then it won't have
192+
// any strange read side effects.
193+
not exists(this.getBaseTypeDestructor())
194+
}
195+
196+
override predicate hasOnlySpecificWriteSideEffects() {
197+
this.getBaseTypeDestructor().(SideEffectFunction).hasOnlySpecificWriteSideEffects()
198+
or
199+
// If there's no declared destructor for the base type then it won't have
200+
// any strange write side effects.
201+
not exists(this.getBaseTypeDestructor())
202+
}
203+
204+
override predicate hasSpecificReadSideEffect(ParameterIndex i, boolean buffer) {
205+
i = -1 and buffer = false
206+
}
207+
208+
override predicate hasSpecificWriteSideEffect(ParameterIndex i, boolean buffer, boolean mustWrite) {
209+
i = -1 and buffer = false and mustWrite = true
210+
}
211+
212+
override predicate parameterNeverEscapes(int index) {
213+
this.getBaseTypeDestructor().(AliasFunction).parameterNeverEscapes(index)
214+
or
215+
// If there's no declared destructor for the base type then it won't cause
216+
// anything to escape.
217+
not exists(this.getBaseTypeDestructor()) and
218+
index = -1
219+
}
220+
221+
override predicate parameterEscapesOnlyViaReturn(int index) {
222+
// A destructor call does not have a return value
223+
none()
224+
}
225+
}

cpp/ql/test/library-tests/ir/ir/operand_locations.expected

Lines changed: 25 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -10952,13 +10952,13 @@
1095210952
| perf-regression.cpp:12:10:12:10 | StoreValue | r12_2 |
1095310953
| smart_ptr.cpp:10:6:10:24 | ChiPartial | partial:m10_3 |
1095410954
| smart_ptr.cpp:10:6:10:24 | ChiTotal | total:m10_2 |
10955-
| smart_ptr.cpp:10:6:10:24 | SideEffect | ~m13_6 |
10955+
| smart_ptr.cpp:10:6:10:24 | SideEffect | ~m12_12 |
1095610956
| smart_ptr.cpp:10:31:10:31 | Address | &:r10_5 |
1095710957
| smart_ptr.cpp:10:31:10:31 | Address | &:r10_5 |
1095810958
| smart_ptr.cpp:10:31:10:31 | Address | &:r10_7 |
1095910959
| smart_ptr.cpp:10:31:10:31 | Address | &:r10_7 |
1096010960
| smart_ptr.cpp:10:31:10:31 | Load | m10_6 |
10961-
| smart_ptr.cpp:10:31:10:31 | SideEffect | m10_8 |
10961+
| smart_ptr.cpp:10:31:10:31 | SideEffect | m12_15 |
1096210962
| smart_ptr.cpp:11:21:11:22 | Address | &:r11_1 |
1096310963
| smart_ptr.cpp:11:21:11:22 | Address | &:r11_1 |
1096410964
| smart_ptr.cpp:11:21:11:22 | Arg(this) | this:r11_1 |
@@ -10981,9 +10981,9 @@
1098110981
| smart_ptr.cpp:12:20:12:27 | Address | &:r12_9 |
1098210982
| smart_ptr.cpp:12:20:12:27 | Arg(0) | 0:r12_9 |
1098310983
| smart_ptr.cpp:12:20:12:27 | ChiPartial | partial:m12_14 |
10984-
| smart_ptr.cpp:12:20:12:27 | ChiTotal | total:m12_12 |
10984+
| smart_ptr.cpp:12:20:12:27 | ChiTotal | total:m10_8 |
1098510985
| smart_ptr.cpp:12:20:12:27 | Load | m12_8 |
10986-
| smart_ptr.cpp:12:20:12:27 | SideEffect | ~m12_12 |
10986+
| smart_ptr.cpp:12:20:12:27 | SideEffect | ~m10_8 |
1098710987
| smart_ptr.cpp:12:24:12:28 | Load | m11_9 |
1098810988
| smart_ptr.cpp:12:24:12:28 | StoreValue | r12_7 |
1098910989
| smart_ptr.cpp:12:25:12:26 | Arg(0) | 0:r12_5 |
@@ -10992,21 +10992,16 @@
1099210992
| smart_ptr.cpp:13:1:13:1 | Address | &:r13_2 |
1099310993
| smart_ptr.cpp:13:1:13:1 | Arg(this) | this:r13_2 |
1099410994
| smart_ptr.cpp:13:1:13:1 | CallTarget | func:r13_3 |
10995-
| smart_ptr.cpp:13:1:13:1 | ChiPartial | partial:m13_5 |
10996-
| smart_ptr.cpp:13:1:13:1 | ChiPartial | partial:m13_8 |
10997-
| smart_ptr.cpp:13:1:13:1 | ChiTotal | total:m11_9 |
10998-
| smart_ptr.cpp:13:1:13:1 | ChiTotal | total:m12_15 |
1099910995
| smart_ptr.cpp:13:1:13:1 | SideEffect | m11_9 |
11000-
| smart_ptr.cpp:13:1:13:1 | SideEffect | ~m12_15 |
1100110996
| smart_ptr.cpp:17:6:17:24 | ChiPartial | partial:m17_3 |
1100210997
| smart_ptr.cpp:17:6:17:24 | ChiTotal | total:m17_2 |
11003-
| smart_ptr.cpp:17:6:17:24 | SideEffect | ~m20_6 |
10998+
| smart_ptr.cpp:17:6:17:24 | SideEffect | ~m19_16 |
1100410999
| smart_ptr.cpp:17:33:17:33 | Address | &:r17_5 |
1100511000
| smart_ptr.cpp:17:33:17:33 | Address | &:r17_5 |
1100611001
| smart_ptr.cpp:17:33:17:33 | Address | &:r17_7 |
1100711002
| smart_ptr.cpp:17:33:17:33 | Address | &:r17_7 |
1100811003
| smart_ptr.cpp:17:33:17:33 | Load | m17_6 |
11009-
| smart_ptr.cpp:17:33:17:33 | SideEffect | m17_8 |
11004+
| smart_ptr.cpp:17:33:17:33 | SideEffect | m19_19 |
1101011005
| smart_ptr.cpp:18:23:18:24 | Address | &:r18_1 |
1101111006
| smart_ptr.cpp:18:23:18:24 | Address | &:r18_1 |
1101211007
| smart_ptr.cpp:18:23:18:24 | Arg(this) | this:r18_1 |
@@ -11033,27 +11028,22 @@
1103311028
| smart_ptr.cpp:19:20:19:21 | CallTarget | func:r19_4 |
1103411029
| smart_ptr.cpp:19:20:19:21 | ChiPartial | partial:m19_9 |
1103511030
| smart_ptr.cpp:19:20:19:21 | ChiPartial | partial:m19_18 |
11031+
| smart_ptr.cpp:19:20:19:21 | ChiTotal | total:m17_8 |
1103611032
| smart_ptr.cpp:19:20:19:21 | ChiTotal | total:m18_8 |
11037-
| smart_ptr.cpp:19:20:19:21 | ChiTotal | total:m19_16 |
1103811033
| smart_ptr.cpp:19:20:19:21 | Load | m19_12 |
1103911034
| smart_ptr.cpp:19:20:19:21 | SideEffect | m18_9 |
11035+
| smart_ptr.cpp:19:20:19:21 | SideEffect | ~m17_8 |
1104011036
| smart_ptr.cpp:19:20:19:21 | SideEffect | ~m18_8 |
11041-
| smart_ptr.cpp:19:20:19:21 | SideEffect | ~m19_16 |
1104211037
| smart_ptr.cpp:19:20:19:21 | Unary | r19_5 |
1104311038
| smart_ptr.cpp:19:20:19:21 | Unary | r19_6 |
1104411039
| smart_ptr.cpp:20:1:20:1 | Address | &:r20_2 |
1104511040
| smart_ptr.cpp:20:1:20:1 | Address | &:r20_2 |
1104611041
| smart_ptr.cpp:20:1:20:1 | Arg(this) | this:r20_2 |
1104711042
| smart_ptr.cpp:20:1:20:1 | CallTarget | func:r20_3 |
11048-
| smart_ptr.cpp:20:1:20:1 | ChiPartial | partial:m20_5 |
11049-
| smart_ptr.cpp:20:1:20:1 | ChiPartial | partial:m20_8 |
11050-
| smart_ptr.cpp:20:1:20:1 | ChiTotal | total:m18_9 |
11051-
| smart_ptr.cpp:20:1:20:1 | ChiTotal | total:m19_19 |
1105211043
| smart_ptr.cpp:20:1:20:1 | SideEffect | m18_9 |
11053-
| smart_ptr.cpp:20:1:20:1 | SideEffect | ~m19_19 |
1105411044
| smart_ptr.cpp:28:6:28:27 | ChiPartial | partial:m28_3 |
1105511045
| smart_ptr.cpp:28:6:28:27 | ChiTotal | total:m28_2 |
11056-
| smart_ptr.cpp:28:6:28:27 | SideEffect | ~m48_38 |
11046+
| smart_ptr.cpp:28:6:28:27 | SideEffect | ~m47_16 |
1105711047
| smart_ptr.cpp:29:27:29:38 | Address | &:r29_1 |
1105811048
| smart_ptr.cpp:31:5:31:24 | CallTarget | func:r31_1 |
1105911049
| smart_ptr.cpp:31:5:31:24 | ChiPartial | partial:m31_15 |
@@ -11175,54 +11165,29 @@
1117511165
| smart_ptr.cpp:47:43:47:63 | Unary | r47_6 |
1117611166
| smart_ptr.cpp:48:1:48:1 | Address | &:r48_2 |
1117711167
| smart_ptr.cpp:48:1:48:1 | Address | &:r48_2 |
11178-
| smart_ptr.cpp:48:1:48:1 | Address | &:r48_10 |
11179-
| smart_ptr.cpp:48:1:48:1 | Address | &:r48_10 |
11180-
| smart_ptr.cpp:48:1:48:1 | Address | &:r48_18 |
11181-
| smart_ptr.cpp:48:1:48:1 | Address | &:r48_18 |
11182-
| smart_ptr.cpp:48:1:48:1 | Address | &:r48_26 |
11183-
| smart_ptr.cpp:48:1:48:1 | Address | &:r48_26 |
11184-
| smart_ptr.cpp:48:1:48:1 | Address | &:r48_34 |
11185-
| smart_ptr.cpp:48:1:48:1 | Address | &:r48_34 |
11168+
| smart_ptr.cpp:48:1:48:1 | Address | &:r48_7 |
11169+
| smart_ptr.cpp:48:1:48:1 | Address | &:r48_7 |
11170+
| smart_ptr.cpp:48:1:48:1 | Address | &:r48_12 |
11171+
| smart_ptr.cpp:48:1:48:1 | Address | &:r48_12 |
11172+
| smart_ptr.cpp:48:1:48:1 | Address | &:r48_17 |
11173+
| smart_ptr.cpp:48:1:48:1 | Address | &:r48_17 |
11174+
| smart_ptr.cpp:48:1:48:1 | Address | &:r48_22 |
11175+
| smart_ptr.cpp:48:1:48:1 | Address | &:r48_22 |
1118611176
| smart_ptr.cpp:48:1:48:1 | Arg(this) | this:r48_2 |
11187-
| smart_ptr.cpp:48:1:48:1 | Arg(this) | this:r48_10 |
11188-
| smart_ptr.cpp:48:1:48:1 | Arg(this) | this:r48_18 |
11189-
| smart_ptr.cpp:48:1:48:1 | Arg(this) | this:r48_26 |
11190-
| smart_ptr.cpp:48:1:48:1 | Arg(this) | this:r48_34 |
11177+
| smart_ptr.cpp:48:1:48:1 | Arg(this) | this:r48_7 |
11178+
| smart_ptr.cpp:48:1:48:1 | Arg(this) | this:r48_12 |
11179+
| smart_ptr.cpp:48:1:48:1 | Arg(this) | this:r48_17 |
11180+
| smart_ptr.cpp:48:1:48:1 | Arg(this) | this:r48_22 |
1119111181
| smart_ptr.cpp:48:1:48:1 | CallTarget | func:r48_3 |
11192-
| smart_ptr.cpp:48:1:48:1 | CallTarget | func:r48_11 |
11193-
| smart_ptr.cpp:48:1:48:1 | CallTarget | func:r48_19 |
11194-
| smart_ptr.cpp:48:1:48:1 | CallTarget | func:r48_27 |
11195-
| smart_ptr.cpp:48:1:48:1 | CallTarget | func:r48_35 |
11196-
| smart_ptr.cpp:48:1:48:1 | ChiPartial | partial:m48_5 |
11197-
| smart_ptr.cpp:48:1:48:1 | ChiPartial | partial:m48_8 |
11198-
| smart_ptr.cpp:48:1:48:1 | ChiPartial | partial:m48_13 |
11199-
| smart_ptr.cpp:48:1:48:1 | ChiPartial | partial:m48_16 |
11200-
| smart_ptr.cpp:48:1:48:1 | ChiPartial | partial:m48_21 |
11201-
| smart_ptr.cpp:48:1:48:1 | ChiPartial | partial:m48_24 |
11202-
| smart_ptr.cpp:48:1:48:1 | ChiPartial | partial:m48_29 |
11203-
| smart_ptr.cpp:48:1:48:1 | ChiPartial | partial:m48_32 |
11204-
| smart_ptr.cpp:48:1:48:1 | ChiPartial | partial:m48_37 |
11205-
| smart_ptr.cpp:48:1:48:1 | ChiPartial | partial:m48_40 |
11206-
| smart_ptr.cpp:48:1:48:1 | ChiTotal | total:m29_2 |
11207-
| smart_ptr.cpp:48:1:48:1 | ChiTotal | total:m33_2 |
11208-
| smart_ptr.cpp:48:1:48:1 | ChiTotal | total:m37_2 |
11209-
| smart_ptr.cpp:48:1:48:1 | ChiTotal | total:m41_2 |
11210-
| smart_ptr.cpp:48:1:48:1 | ChiTotal | total:m45_2 |
11211-
| smart_ptr.cpp:48:1:48:1 | ChiTotal | total:m47_16 |
11212-
| smart_ptr.cpp:48:1:48:1 | ChiTotal | total:m48_6 |
11213-
| smart_ptr.cpp:48:1:48:1 | ChiTotal | total:m48_14 |
11214-
| smart_ptr.cpp:48:1:48:1 | ChiTotal | total:m48_22 |
11215-
| smart_ptr.cpp:48:1:48:1 | ChiTotal | total:m48_30 |
11182+
| smart_ptr.cpp:48:1:48:1 | CallTarget | func:r48_8 |
11183+
| smart_ptr.cpp:48:1:48:1 | CallTarget | func:r48_13 |
11184+
| smart_ptr.cpp:48:1:48:1 | CallTarget | func:r48_18 |
11185+
| smart_ptr.cpp:48:1:48:1 | CallTarget | func:r48_23 |
1121611186
| smart_ptr.cpp:48:1:48:1 | SideEffect | m29_2 |
1121711187
| smart_ptr.cpp:48:1:48:1 | SideEffect | m33_2 |
1121811188
| smart_ptr.cpp:48:1:48:1 | SideEffect | m37_2 |
1121911189
| smart_ptr.cpp:48:1:48:1 | SideEffect | m41_2 |
1122011190
| smart_ptr.cpp:48:1:48:1 | SideEffect | m45_2 |
11221-
| smart_ptr.cpp:48:1:48:1 | SideEffect | ~m47_16 |
11222-
| smart_ptr.cpp:48:1:48:1 | SideEffect | ~m48_6 |
11223-
| smart_ptr.cpp:48:1:48:1 | SideEffect | ~m48_14 |
11224-
| smart_ptr.cpp:48:1:48:1 | SideEffect | ~m48_22 |
11225-
| smart_ptr.cpp:48:1:48:1 | SideEffect | ~m48_30 |
1122611191
| struct_init.cpp:9:13:9:25 | Left | r9_3 |
1122711192
| struct_init.cpp:9:13:9:25 | Left | r9_3 |
1122811193
| struct_init.cpp:9:13:9:25 | SideEffect | ~m11_10 |

cpp/ql/test/library-tests/ir/ir/raw_ir.expected

Lines changed: 26 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -12469,9 +12469,8 @@ smart_ptr.cpp:
1246912469
# 13| r13_2(glval<unique_ptr<int, default_delete<int>>>) = VariableAddress[up] :
1247012470
# 13| r13_3(glval<unknown>) = FunctionAddress[~unique_ptr] :
1247112471
# 13| v13_4(void) = Call[~unique_ptr] : func:r13_3, this:r13_2
12472-
# 13| mu13_5(unknown) = ^CallSideEffect : ~m?
12473-
# 13| v13_6(void) = ^IndirectReadSideEffect[-1] : &:r13_2, ~m?
12474-
# 13| mu13_7(unique_ptr<int, default_delete<int>>) = ^IndirectMayWriteSideEffect[-1] : &:r13_2
12472+
# 13| v13_5(void) = ^IndirectReadSideEffect[-1] : &:r13_2, ~m?
12473+
# 13| mu13_6(unique_ptr<int, default_delete<int>>) = ^IndirectMustWriteSideEffect[-1] : &:r13_2
1247512474
# 10| v10_8(void) = ReturnIndirection[p] : &:r10_6, ~m?
1247612475
# 10| v10_9(void) = ReturnVoid :
1247712476
# 10| v10_10(void) = AliasedUse : ~m?
@@ -12514,9 +12513,8 @@ smart_ptr.cpp:
1251412513
# 20| r20_2(glval<shared_ptr<float>>) = VariableAddress[sp] :
1251512514
# 20| r20_3(glval<unknown>) = FunctionAddress[~shared_ptr] :
1251612515
# 20| v20_4(void) = Call[~shared_ptr] : func:r20_3, this:r20_2
12517-
# 20| mu20_5(unknown) = ^CallSideEffect : ~m?
12518-
# 20| v20_6(void) = ^IndirectReadSideEffect[-1] : &:r20_2, ~m?
12519-
# 20| mu20_7(shared_ptr<float>) = ^IndirectMayWriteSideEffect[-1] : &:r20_2
12516+
# 20| v20_5(void) = ^IndirectReadSideEffect[-1] : &:r20_2, ~m?
12517+
# 20| mu20_6(shared_ptr<float>) = ^IndirectMustWriteSideEffect[-1] : &:r20_2
1252012518
# 17| v17_8(void) = ReturnIndirection[p] : &:r17_6, ~m?
1252112519
# 17| v17_9(void) = ReturnVoid :
1252212520
# 17| v17_10(void) = AliasedUse : ~m?
@@ -12619,33 +12617,28 @@ smart_ptr.cpp:
1261912617
# 48| r48_2(glval<shared_ptr<const shared_ptr<const int>>>) = VariableAddress[sp_const_sp_const_int] :
1262012618
# 48| r48_3(glval<unknown>) = FunctionAddress[~shared_ptr] :
1262112619
# 48| v48_4(void) = Call[~shared_ptr] : func:r48_3, this:r48_2
12622-
# 48| mu48_5(unknown) = ^CallSideEffect : ~m?
12623-
# 48| v48_6(void) = ^IndirectReadSideEffect[-1] : &:r48_2, ~m?
12624-
# 48| mu48_7(shared_ptr<const shared_ptr<const int>>) = ^IndirectMayWriteSideEffect[-1] : &:r48_2
12625-
# 48| r48_8(glval<shared_ptr<const shared_ptr<int>>>) = VariableAddress[sp_const_sp_int] :
12626-
# 48| r48_9(glval<unknown>) = FunctionAddress[~shared_ptr] :
12627-
# 48| v48_10(void) = Call[~shared_ptr] : func:r48_9, this:r48_8
12628-
# 48| mu48_11(unknown) = ^CallSideEffect : ~m?
12629-
# 48| v48_12(void) = ^IndirectReadSideEffect[-1] : &:r48_8, ~m?
12630-
# 48| mu48_13(shared_ptr<const shared_ptr<int>>) = ^IndirectMayWriteSideEffect[-1] : &:r48_8
12631-
# 48| r48_14(glval<shared_ptr<shared_ptr<const int>>>) = VariableAddress[sp_sp_const_int] :
12632-
# 48| r48_15(glval<unknown>) = FunctionAddress[~shared_ptr] :
12633-
# 48| v48_16(void) = Call[~shared_ptr] : func:r48_15, this:r48_14
12634-
# 48| mu48_17(unknown) = ^CallSideEffect : ~m?
12635-
# 48| v48_18(void) = ^IndirectReadSideEffect[-1] : &:r48_14, ~m?
12636-
# 48| mu48_19(shared_ptr<shared_ptr<const int>>) = ^IndirectMayWriteSideEffect[-1] : &:r48_14
12637-
# 48| r48_20(glval<shared_ptr<int *const>>) = VariableAddress[sp_const_int_pointer] :
12638-
# 48| r48_21(glval<unknown>) = FunctionAddress[~shared_ptr] :
12639-
# 48| v48_22(void) = Call[~shared_ptr] : func:r48_21, this:r48_20
12640-
# 48| mu48_23(unknown) = ^CallSideEffect : ~m?
12641-
# 48| v48_24(void) = ^IndirectReadSideEffect[-1] : &:r48_20, ~m?
12642-
# 48| mu48_25(shared_ptr<int *const>) = ^IndirectMayWriteSideEffect[-1] : &:r48_20
12643-
# 48| r48_26(glval<shared_ptr<const int>>) = VariableAddress[sp_const_int] :
12644-
# 48| r48_27(glval<unknown>) = FunctionAddress[~shared_ptr] :
12645-
# 48| v48_28(void) = Call[~shared_ptr] : func:r48_27, this:r48_26
12646-
# 48| mu48_29(unknown) = ^CallSideEffect : ~m?
12647-
# 48| v48_30(void) = ^IndirectReadSideEffect[-1] : &:r48_26, ~m?
12648-
# 48| mu48_31(shared_ptr<const int>) = ^IndirectMayWriteSideEffect[-1] : &:r48_26
12620+
# 48| v48_5(void) = ^IndirectReadSideEffect[-1] : &:r48_2, ~m?
12621+
# 48| mu48_6(shared_ptr<const shared_ptr<const int>>) = ^IndirectMustWriteSideEffect[-1] : &:r48_2
12622+
# 48| r48_7(glval<shared_ptr<const shared_ptr<int>>>) = VariableAddress[sp_const_sp_int] :
12623+
# 48| r48_8(glval<unknown>) = FunctionAddress[~shared_ptr] :
12624+
# 48| v48_9(void) = Call[~shared_ptr] : func:r48_8, this:r48_7
12625+
# 48| v48_10(void) = ^IndirectReadSideEffect[-1] : &:r48_7, ~m?
12626+
# 48| mu48_11(shared_ptr<const shared_ptr<int>>) = ^IndirectMustWriteSideEffect[-1] : &:r48_7
12627+
# 48| r48_12(glval<shared_ptr<shared_ptr<const int>>>) = VariableAddress[sp_sp_const_int] :
12628+
# 48| r48_13(glval<unknown>) = FunctionAddress[~shared_ptr] :
12629+
# 48| v48_14(void) = Call[~shared_ptr] : func:r48_13, this:r48_12
12630+
# 48| v48_15(void) = ^IndirectReadSideEffect[-1] : &:r48_12, ~m?
12631+
# 48| mu48_16(shared_ptr<shared_ptr<const int>>) = ^IndirectMustWriteSideEffect[-1] : &:r48_12
12632+
# 48| r48_17(glval<shared_ptr<int *const>>) = VariableAddress[sp_const_int_pointer] :
12633+
# 48| r48_18(glval<unknown>) = FunctionAddress[~shared_ptr] :
12634+
# 48| v48_19(void) = Call[~shared_ptr] : func:r48_18, this:r48_17
12635+
# 48| v48_20(void) = ^IndirectReadSideEffect[-1] : &:r48_17, ~m?
12636+
# 48| mu48_21(shared_ptr<int *const>) = ^IndirectMustWriteSideEffect[-1] : &:r48_17
12637+
# 48| r48_22(glval<shared_ptr<const int>>) = VariableAddress[sp_const_int] :
12638+
# 48| r48_23(glval<unknown>) = FunctionAddress[~shared_ptr] :
12639+
# 48| v48_24(void) = Call[~shared_ptr] : func:r48_23, this:r48_22
12640+
# 48| v48_25(void) = ^IndirectReadSideEffect[-1] : &:r48_22, ~m?
12641+
# 48| mu48_26(shared_ptr<const int>) = ^IndirectMustWriteSideEffect[-1] : &:r48_22
1264912642
# 28| v28_4(void) = ReturnVoid :
1265012643
# 28| v28_5(void) = AliasedUse : ~m?
1265112644
# 28| v28_6(void) = ExitFunction :

0 commit comments

Comments
 (0)