[absint] escape for xml when dumping info to html debug

Summary: Fixes issues with printing templated stuff that looks suspiciously like HTML tags otherwise.

Reviewed By: mbouaziz

Differential Revision: D9239280

fbshipit-source-id: f008ce6da
master
Jules Villard 6 years ago committed by Facebook Github Bot
parent e5a5d64760
commit b8c5dc84ba

@ -74,8 +74,9 @@ struct
NodePrinter.start_session ~pp_name underlying_node ; NodePrinter.start_session ~pp_name underlying_node ;
let left, right, result = match op with `Join lrr | `Widen (_, lrr) -> lrr in let left, right, result = match op with `Join lrr | `Widen (_, lrr) -> lrr in
L.d_strln L.d_strln
(Format.asprintf "LEFT: %a@.RIGHT: %a@.RESULT: %a@." Domain.pp left Domain.pp right Domain.pp ( Format.asprintf "LEFT: %a@.RIGHT: %a@.RESULT: %a@." Domain.pp left Domain.pp right
result) ; Domain.pp result
|> Escape.escape_xml ) ;
NodePrinter.finish_session underlying_node NodePrinter.finish_session underlying_node
@ -95,7 +96,8 @@ struct
L.d_strln L.d_strln
( Format.asprintf "@[PRE: %a@]@\n@[INSTRS: %a@]@[POST: %a@]@." Domain.pp pre ( Format.asprintf "@[PRE: %a@]@\n@[INSTRS: %a@]@[POST: %a@]@." Domain.pp pre
(Instrs.pp Pp.(html Green)) (Instrs.pp Pp.(html Green))
instrs Domain.pp astate_post) ; instrs Domain.pp astate_post
|> Escape.escape_xml ) ;
NodePrinter.finish_session (Node.underlying_node node) ) ; NodePrinter.finish_session (Node.underlying_node node) ) ;
let inv_map' = InvariantMap.add node_id {pre; post= astate_post; visit_count} inv_map in let inv_map' = InvariantMap.add node_id {pre; post= astate_post; visit_count} inv_map in
(inv_map', Scheduler.schedule_succs work_queue node) (inv_map', Scheduler.schedule_succs work_queue node)

@ -35,7 +35,8 @@ struct
NodePrinter.start_session ~pp_name:(pp_session_name node) underyling_node ; NodePrinter.start_session ~pp_name:(pp_session_name node) underyling_node ;
L.d_strln L.d_strln
( Format.asprintf "PRE: %a@.INSTR: %a@.POST: %a@." TransferFunctions.Domain.pp pre ( Format.asprintf "PRE: %a@.INSTR: %a@.POST: %a@." TransferFunctions.Domain.pp pre
HilInstr.pp hil_instr TransferFunctions.Domain.pp post) ; HilInstr.pp hil_instr TransferFunctions.Domain.pp post
|> Escape.escape_xml ) ;
NodePrinter.finish_session underyling_node ) NodePrinter.finish_session underyling_node )

Loading…
Cancel
Save