|
|
@ -52,7 +52,7 @@ let replace_statement =
|
|
|
|
ResultsDatabase.register_statement
|
|
|
|
ResultsDatabase.register_statement
|
|
|
|
{|
|
|
|
|
{|
|
|
|
|
INSERT OR REPLACE INTO procedures
|
|
|
|
INSERT OR REPLACE INTO procedures
|
|
|
|
SELECT :pname, :proc_name_hum, :akind, :sfile, :pattr, :cfg
|
|
|
|
SELECT :pname, :proc_name_hum, :akind, :sfile, :pattr, :cfg, :callees
|
|
|
|
FROM (
|
|
|
|
FROM (
|
|
|
|
SELECT NULL
|
|
|
|
SELECT NULL
|
|
|
|
FROM (
|
|
|
|
FROM (
|
|
|
@ -64,7 +64,7 @@ FROM (
|
|
|
|
OR (attr_kind = :akind AND source_file <= :sfile) )|}
|
|
|
|
OR (attr_kind = :akind AND source_file <= :sfile) )|}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let replace pname pname_blob akind loc_file attr_blob proc_desc =
|
|
|
|
let replace pname pname_blob akind loc_file attr_blob proc_desc callees =
|
|
|
|
ResultsDatabase.with_registered_statement replace_statement ~f:(fun db replace_stmt ->
|
|
|
|
ResultsDatabase.with_registered_statement replace_statement ~f:(fun db replace_stmt ->
|
|
|
|
Sqlite3.bind replace_stmt 1 (* :pname *) pname_blob
|
|
|
|
Sqlite3.bind replace_stmt 1 (* :pname *) pname_blob
|
|
|
|
|> SqliteUtils.check_result_code db ~log:"replace bind pname" ;
|
|
|
|
|> SqliteUtils.check_result_code db ~log:"replace bind pname" ;
|
|
|
@ -79,6 +79,8 @@ let replace pname pname_blob akind loc_file attr_blob proc_desc =
|
|
|
|
|> SqliteUtils.check_result_code db ~log:"replace bind proc attributes" ;
|
|
|
|
|> SqliteUtils.check_result_code db ~log:"replace bind proc attributes" ;
|
|
|
|
Sqlite3.bind replace_stmt 6 (* :cfg *) (Procdesc.SQLite.serialize proc_desc)
|
|
|
|
Sqlite3.bind replace_stmt 6 (* :cfg *) (Procdesc.SQLite.serialize proc_desc)
|
|
|
|
|> SqliteUtils.check_result_code db ~log:"replace bind cfg" ;
|
|
|
|
|> SqliteUtils.check_result_code db ~log:"replace bind cfg" ;
|
|
|
|
|
|
|
|
Sqlite3.bind replace_stmt 7 (* :callees *) (Typ.Procname.SQLiteList.serialize callees)
|
|
|
|
|
|
|
|
|> SqliteUtils.check_result_code db ~log:"replace bind callees" ;
|
|
|
|
SqliteUtils.result_unit db ~finalize:false ~log:"Attributes.replace" replace_stmt )
|
|
|
|
SqliteUtils.result_unit db ~finalize:false ~log:"Attributes.replace" replace_stmt )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -134,6 +136,7 @@ let store ~proc_desc (attr : ProcAttributes.t) =
|
|
|
|
(SourceFile.SQLite.serialize attr.loc.Location.file)
|
|
|
|
(SourceFile.SQLite.serialize attr.loc.Location.file)
|
|
|
|
(ProcAttributes.SQLite.serialize attr)
|
|
|
|
(ProcAttributes.SQLite.serialize attr)
|
|
|
|
proc_desc
|
|
|
|
proc_desc
|
|
|
|
|
|
|
|
(Option.map proc_desc ~f:Procdesc.get_static_callees |> Option.value ~default:[])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let load_defined pname = Typ.Procname.SQLite.serialize pname |> find ~defined:true
|
|
|
|
let load_defined pname = Typ.Procname.SQLite.serialize pname |> find ~defined:true
|
|
|
|