Skip to content
Snippets Groups Projects

Fix potential stack overflow related to `Pretty N`.

Merged Robbert Krebbers requested to merge robbert/pretty_N_go_stackoverflow into master
All threads resolved!
1 file
+ 1
1
Compare changes
  • Side-by-side
  • Inline
+ 1
1
@@ -22,7 +22,7 @@ Fixpoint pretty_N_go_help (x : N) (acc : Acc (<)%N x) (s : string) : string :=
(String (pretty_N_char (x `mod` 10)) s)
| right _ => s
end.
(* The argument [S (N.size_nat x)] of [wf_guard] makes sure that computation
(** The argument [S (N.size_nat x)] of [wf_guard] makes sure that computation
works if [x] is a closed term, but that it blocks if [x] is an open term. The
latter prevents unexpected stack overflows, see [tests/pretty.v]. *)
Definition pretty_N_go (x : N) : string string :=
Loading