Skip to content
Snippets Groups Projects
Commit 89a23996 authored by Patrick Baudin's avatar Patrick Baudin Committed by Andre Maroneze
Browse files

[ptests] prevents infinite recursion in macro expansion

parent 671710af
No related branches found
No related tags found
No related merge requests found
......@@ -785,7 +785,11 @@ struct
let has_frama_c_exe = ref false in
if !verbosity >= 4 then lock_printf "%% Expand: %s@." s;
if !verbosity >= 5 then print_macros macros;
let nb_loops = ref 0 in
let rec aux s =
if !nb_loops > 100 then
fail "Possible infinite recursion in macro expands"
else incr nb_loops ;
let expand_macro = function
| Str.Text s -> s
| Str.Delim s ->
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment