From 30a2cff13c9641f144d4f923c963ef0d8cd89850 Mon Sep 17 00:00:00 2001 From: Simmo Saan Date: Wed, 22 Feb 2023 14:47:25 +0200 Subject: [PATCH] Use function end location for pseudo return node --- src/framework/cfgTools.ml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/framework/cfgTools.ml b/src/framework/cfgTools.ml index c4e2b977656..28ca8fab1b1 100644 --- a/src/framework/cfgTools.ml +++ b/src/framework/cfgTools.ml @@ -233,12 +233,13 @@ let createCFG (file: file) = * lazy, so it's only added when actually needed *) let pseudo_return = lazy ( if Messages.tracing then Messages.trace "cfg" "adding pseudo-return to the function %s.\n" fd.svar.vname; - let newst = mkStmt (Return (None, fd_loc)) in + let fd_end_loc = {fd_loc with line = fd_loc.endLine; byte = fd_loc.endByte; column = fd_loc.endColumn} in + let newst = mkStmt (Return (None, fd_end_loc)) in newst.sid <- get_pseudo_return_id fd; Cilfacade.StmtH.add Cilfacade.pseudo_return_to_fun newst fd; Cilfacade.IntH.replace Cilfacade.pseudo_return_stmt_sids newst.sid newst; let newst_node = Statement newst in - addEdge newst_node (fd_loc, Ret (None, fd)) (Function fd); + addEdge newst_node (fd_end_loc, Ret (None, fd)) (Function fd); newst_node ) in