Frama-C-discuss mailing list archives
This page gathers the archives of the old Frama-C-discuss archives, that was hosted by Inria's gforge before its demise at the end of 2020. To search for mails newer than September 2020, please visit the page of the new mailing list on Renater.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Frama-c-discuss] How to transform a statement with case label by using the visitor?
- Subject: [Frama-c-discuss] How to transform a statement with case label by using the visitor?
- From: abiao.yang at gmail.com (David Yang)
- Date: Fri, 16 May 2014 14:59:41 +0800
- In-reply-to: <CAA1cxugW-gWowhR8m0UFFyc9XAeEkckynJu6oJqQpNKHeg17Hg@mail.gmail.com>
- References: <CAA1cxugW-gWowhR8m0UFFyc9XAeEkckynJu6oJqQpNKHeg17Hg@mail.gmail.com>
just update the question! I have been solved this problem by changing this piece of code On 16 May 2014 03:29, David Yang <abiao.yang at gmail.com> wrote: > match lval with > | Some(Var vi, _) -> > begin > let instr = Cil_types.Set(Cil.var vi, Cil.integer ~loc 1, loc) in > let insert_stmt = Cil.mkStmt (Cil_types.Instr instr) in > insert_stmt.labels <- stmt.labels; > stmt.labels <- []; > let bloc_kind = Cil_types.Block(Cil.mkBlock [insert_stmt; stmt]) in > let new_stmt = Cil.mkStmt bloc_kind in > Cil.ChangeTo new_stmt > end > | _ -> Cil.DoChildren into: (* ===============update code ================= *) match lval with | Some(Var vi, _) -> begin let instr = Cil_types.Set(Cil.var vi, Cil.integer ~loc 1, loc) in let insert_stmt = Cil.mkStmt (Cil_types.Instr instr) in let dstmt = Cil.dummyStmt in dstmt.skind <- stmt.skind; let bloc_kind = Cil_types.Block(Cil.mkBlock [insert_stmt; dstmt]) in stmt.skind <- bloc_kind; Cil.ChangeTo stmt end | _ -> Cil.DoChildren
- References:
- [Frama-c-discuss] How to transform a statement with case label by using the visitor?
- From: abiao.yang at gmail.com (David Yang)
- [Frama-c-discuss] How to transform a statement with case label by using the visitor?
- Prev by Date: [Frama-c-discuss] How to transform a statement with case label by using the visitor?
- Next by Date: [Frama-c-discuss] Puzzled about apparent proof of false contract
- Previous by thread: [Frama-c-discuss] How to transform a statement with case label by using the visitor?
- Next by thread: [Frama-c-discuss] Puzzled about apparent proof of false contract
- Index(es):