Skip to content

Commit 3be0822

Browse files
committed
Fix disabled msg_group segfault
Regression from e362a45.
1 parent 840f4dd commit 3be0822

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/util/messages.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ let msg severity ?loc ?(tags=[]) ?(category=Category.Unknown) fmt =
260260
Pretty.gprintf finish fmt
261261
)
262262
else
263-
Tracing.mygprintf fmt
263+
Tracing.mygprintf () fmt
264264

265265
let msg_noloc severity ?(tags=[]) ?(category=Category.Unknown) fmt =
266266
if !GU.should_warn && Severity.should_warn severity && (Category.should_warn category || Tags.should_warn tags) then (
@@ -271,7 +271,7 @@ let msg_noloc severity ?(tags=[]) ?(category=Category.Unknown) fmt =
271271
Pretty.gprintf finish fmt
272272
)
273273
else
274-
Tracing.mygprintf fmt
274+
Tracing.mygprintf () fmt
275275

276276
let msg_group severity ?(tags=[]) ?(category=Category.Unknown) fmt =
277277
if !GU.should_warn && Severity.should_warn severity && (Category.should_warn category || Tags.should_warn tags) then (
@@ -286,7 +286,7 @@ let msg_group severity ?(tags=[]) ?(category=Category.Unknown) fmt =
286286
Pretty.gprintf finish fmt
287287
)
288288
else
289-
Tracing.mygprintf fmt
289+
Tracing.mygprintf (fun msgs -> ()) fmt
290290

291291
(* must eta-expand to get proper (non-weak) polymorphism for format *)
292292
let warn ?loc = msg Warning ?loc

src/util/tracing.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ let traceIndent () = indent_level := !indent_level + 2
3232
let traceOutdent () = indent_level := !indent_level - 2
3333

3434
(* Parses a format string to generate a nop-function of the correct type. *)
35-
let mygprintf (format : ('a, unit, doc, 'b) format4) : 'a =
35+
let mygprintf (finish: 'b) (format : ('a, unit, doc, 'b) format4) : 'a =
3636
let format = string_of_format format in
3737
let flen = String.length format in
3838
let fget = String.unsafe_get format in
@@ -46,7 +46,7 @@ let mygprintf (format : ('a, unit, doc, 'b) format4) : 'a =
4646
skipChars (succ i)
4747
and collect (acc: doc) (i: int) =
4848
if i >= flen then begin
49-
Obj.magic (())
49+
Obj.magic finish
5050
end else begin
5151
let c = fget i in
5252
if c = '%' then begin
@@ -104,7 +104,7 @@ let gtrace always f sys var ?loc do_subsys fmt =
104104
do_subsys ();
105105
gprintf (f sys) fmt
106106
end else
107-
mygprintf fmt
107+
mygprintf () fmt
108108

109109
let trace sys ?var fmt = gtrace true printtrace sys var ignore fmt
110110

0 commit comments

Comments
 (0)