From 8ee361714b373c8089f0d593a08a24b6d055b73a Mon Sep 17 00:00:00 2001 From: Virgile Prevosto <virgile.prevosto@m4x.org> Date: Thu, 19 Jan 2023 17:26:10 +0100 Subject: [PATCH] [printer] make a function tailrec to avoid stack overflow --- src/kernel_services/ast_printing/cil_printer.ml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/kernel_services/ast_printing/cil_printer.ml b/src/kernel_services/ast_printing/cil_printer.ml index 6853fe7e402..32804d40074 100644 --- a/src/kernel_services/ast_printing/cil_printer.ml +++ b/src/kernel_services/ast_printing/cil_printer.ml @@ -1393,9 +1393,9 @@ class cil_printer () = object (self) if cut && not inline && not braces then pp_print_cut fmt (); self#next_stmt Cil.invalidStmt fmt s | s_cur :: (s_next :: _ as tail) -> - Format.fprintf fmt "%a@ %a" - (self#next_stmt s_next) s_cur - (iterblock ~cut:false) tail + Format.fprintf fmt "%a@ " + (self#next_stmt s_next) s_cur; + (iterblock[@tailcall]) ~cut:false fmt tail in let stmts = blk.bstmts in if stmts = [] && not braces then fprintf fmt ";" -- GitLab