Translate destructor calls

Reviewed By: akotulski

Differential Revision: D3035382

fb-gh-sync-id: 3dba93e
shipit-source-id: 3dba93e
master
Dulma Rodriguez 9 years ago committed by Facebook Github Bot 5
parent 14f329ba59
commit a4b87a0951

@ -597,7 +597,7 @@ struct
| `Var | `ImplicitParam | `ParmVar -> var_deref_trans trans_state stmt_info decl_ref
| `Field | `ObjCIvar ->
field_deref_trans trans_state stmt_info pre_trans_result decl_ref ~is_constructor_init
| `CXXMethod | `CXXConversion | `CXXConstructor ->
| `CXXMethod | `CXXConversion | `CXXConstructor | `CXXDestructor ->
method_deref_trans trans_state pre_trans_result decl_ref stmt_info decl_kind
| _ ->
let print_error decl_kind =

@ -0,0 +1,15 @@
/*
* Copyright (c) 2016 - present Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
struct Person {
int age;
~Person();
};
void f(Person* p) { p->Person::~Person(); }

@ -0,0 +1,13 @@
digraph iCFG {
3 [label="3: Call _fun_Person_~Person \n n$0=*&p:class Person * [line 15]\n n$1=*n$0:class Person [line 15]\n _fun_Person_~Person(n$0:class Person *) [line 15]\n REMOVE_TEMPS(n$0,n$1); [line 15]\n NULLIFY(&p,false); [line 15]\n APPLY_ABSTRACTION; [line 15]\n " shape="box"]
3 -> 2 ;
2 [label="2: Exit f \n " color=yellow style=filled]
1 [label="1: Start f\nFormals: p:class Person *\nLocals: \n DECLARE_LOCALS(&return); [line 15]\n " color=yellow style=filled]
1 -> 3 ;
}

@ -46,4 +46,10 @@ public class DestructorsTest {
throws InterruptedException, IOException, InferException {
frontendTest("pseudo_destructor_expr.cpp");
}
@Test
public void testCallOnCallDestructorDotFilesMatch()
throws InterruptedException, IOException, InferException {
frontendTest("call_destructor.cpp");
}
}

Loading…
Cancel
Save